OFFSET
0,3
COMMENTS
The coin system defined by these values is canonical (the greedy algorithm always yields the minimal number of coins). This has been verified for all amounts less than $150, which is sufficient. Please refer to Kozen and Zaks (1994). - Adam Reichert, Jun 25 2026
LINKS
Adam Reichert, Table of n, a(n) for n = 0..10000
D. Kozen and S. Zaks, Optimal Bounds for the Change-Making Problem, Theoretical Computer Science, 123 (1994), 377-388.
Adam Reichert, Python program for verifying if a coin system is canonical
US Treasury, Denominations of Coins
US Treasury, Denominations of Paper Currency
PROG
(Python)
def how_many(cents):
#d = denominations
d = ['$0.01', '$0.05', '$0.10', '$0.25',
'$1', '$5', '$10', '$20', '$50', '$100']
coins = {coin: 100*float(str(coin)[1:]) for coin in d}
how_many = {d[i]: 0 for i in range(10)}
while len(d) != 0:
how_many[d[-1]] = cents // coins[d[-1]]
cents %= coins[d[-1]]
d.pop()
return int(sum(how_many.values()))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Edward Minnix III, Nov 15 2015
EXTENSIONS
Edited by N. J. A. Sloane, Apr 24 2016
STATUS
approved
