Coin Problem

Author

Eric W. Weisstein
January 12, 2007

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Combinatorics/CoinProblem.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/CoinProblem.html.

©2007 Wolfram Research, Inc. except for portions noted otherwise

Two Coins

<<NumberTheory`Frobenius`

TwoCoins1[l_]:=Module[{n},Position[Table[GreedyDecomposition[l,n],{n,100}],{}][[-1,1]]
]

TwoCoins2[{a1_,a2_}]:=(a1-1)(a2-1)-1

TableForm[Transpose[Partition[DeleteCases[Flatten[Table[{{a1,a2},
{FrobeniusF[{a1,a2}],TwoCoins1[{a1,a2}],TwoCoins2[{a1,a2}]}},{a1,2,7},{a2,a1+1,10}],1],{_,{∞,__}}],10]],TableDepth->2]

Three Coins

TableForm[DeleteCases[Flatten[Table[{{a1,a2,a3},
{FrobeniusF[{a1,a2,a3}],TwoCoins1[{a1,a2,a3}]}},{a1,2,7},{a2,a1+1,7},{a3,a2+1,7}],2],{_,{∞,__}}],TableDepth->2]