Count the coins: Difference between revisions

Line 2,163:
ways2(100,[1,5,10,25]);
# 242
 
ways2(100,[1,5,10,25,50,100]);
# 293
 
ways2(1000,[1,5,10,25,50,100]);
Line 2,181 ⟶ 2,184:
ways2(100000000,[1,5,10,25,50,100]);
# 13333398333445333413833354500001</lang>
 
Additionally, while it's not proved as is, we can see that the first values for an amount 10^k obey the following simple formula:
 
<lang maple>ways3:=k->4*10^(5*k-9)/3+2*10^(k-3)/3+65*10^(4*k-8)+112*10^(3*k-6)+805*10^(2*k-5)+211*10^(k-3)+1:
 
for k from 2 to 8 do lprint(ways3(k)) od;
293
2103596
139946140451
13398445413854501
1333983445341383545001
133339833445334138335450001
13333398333445333413833354500001</lang>
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
175

edits