In a (huge) piggy bank I have a number of identical € coins for a total of less than euros. I can arrange them into either a cube or two pyramids : a regular one and a tetrahedral one.
After spending some amount of money, I find that I can still recreate the same arrangement (a cube or one tetrahedral and one regular pyramid) with the remaining coins.
How much did I spent (in €) ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
In a square pyramid of coins, the n th layer (counting from the top) would contain n 2 coins. In a tetrahedral pyramid, the same layer would contain T n coins, where T n is the n th triangular number, whose formula is 2 n ( n + 1 ) .
Let S P m and T P n be the number of coins in a square pyramid and a tetrahedral pyramid with m and n layers, respectively. Then
S P m T P n = 1 + 4 + 9 + … + m 2 = k = 1 ∑ m k 2 = 6 m ( m + 1 ) ( 2 m + 1 ) = 1 + 3 + 6 + 1 0 + … + T n = k = 1 ∑ n 2 k ( k + 1 ) = 2 1 ( k = 1 ∑ n k 2 + k = 1 ∑ n k ) = 2 1 ( 6 n ( n + 1 ) ( 2 n + 1 ) + 2 n ( n + 1 ) ) = 2 n ( n + 1 ) ( 6 2 n + 1 + 2 1 ) = 6 n ( n + 1 ) ( n + 2 )
So we are seeking two sets of ( m , n ) such that S P m + T P n are perfect cubes no greater than 5000.
This seems difficult (impossible?) to solve analytically, so we resort to a program and find three sets of values for ( m , n ) : ( 1 , 1 9 ) , ( 2 , 8 ) and ( 1 6 , 2 4 )
We discard the first as m = 1 would be a single coin and not qualify as a pyramid.
This leaves S P 2 + T P 8 = 1 2 5 = 5 3 and S P 1 6 + T P 2 4 = 4 0 9 6 = 1 6 3 , so the amount spent was 4 0 9 6 − 1 2 5 = 3 9 7 1