Count the coins: Difference between revisions

Content added Content deleted
Line 2,187: Line 2,187:
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:
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/3*10^(5*k-9)+65*10^(4*k-8)+112*10^(3*k-6)+805*10^(2*k-5)+635/3*10^(k-3)+1:
<lang maple>P:=n->4/(3*10^9)*n^5+65/10^8*n^4+112/10^6*n^3+805/10^5*n^2+635/3000*n+1:


for k from 2 to 8 do lprint(ways3(k)) od;
for k from 2 to 8 do lprint(P(10^k)) od:
293
293
2103596
2103596
Line 2,197: Line 2,197:
133339833445334138335450001
133339833445334138335450001
13333398333445333413833354500001</lang>
13333398333445333413833354500001</lang>

The polynomial P(n) seems to give the correct number of ways iff n is a multiple of 100 (tested up to n=10000000).


=={{header|Mathematica}} / {{header|Wolfram Language}}==
=={{header|Mathematica}} / {{header|Wolfram Language}}==