Implementation of a coinage algorithm