Piggy Bank Diet

Number Theory Level pending

In a (huge) piggy bank I have a number of identical 1 1 € coins for a total of less than 5000 5000 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 €) ?


The answer is 3971.

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.

2 solutions

Zico Quintina
Jun 26, 2018

In a square pyramid of coins, the n n th layer (counting from the top) would contain n 2 n^2 coins. In a tetrahedral pyramid, the same layer would contain T n T_n coins, where T n T_n is the n n th triangular number, whose formula is n ( n + 1 ) 2 \frac{n(n + 1)}{2} .

Let S P m SP_m and T P n TP_n be the number of coins in a square pyramid and a tetrahedral pyramid with m m and n n layers, respectively. Then

S P m = 1 + 4 + 9 + + m 2 = k = 1 m k 2 = m ( m + 1 ) ( 2 m + 1 ) 6 T P n = 1 + 3 + 6 + 10 + + T n = k = 1 n k ( k + 1 ) 2 = 1 2 ( k = 1 n k 2 + k = 1 n k ) = 1 2 ( n ( n + 1 ) ( 2 n + 1 ) 6 + n ( n + 1 ) 2 ) = n ( n + 1 ) 2 ( 2 n + 1 6 + 1 2 ) = n ( n + 1 ) ( n + 2 ) 6 \begin{array}{rl} SP_m &= \ \ 1 + 4 + 9 + \ldots + m^2 \\ \\ &= \ \ \displaystyle \sum_{k = 1}^m k^2 \\ \\ &= \ \ \dfrac{m(m + 1)(2m + 1)}{6} \\ \\ \\ TP_n &= \ \ 1 + 3 + 6 + 10 + \ldots + T_n \\ \\ &= \ \ \displaystyle \sum_{k = 1}^n \dfrac{k(k + 1)}{2} \\ \\ &= \ \ \dfrac{1}{2} \left( \displaystyle \sum_{k = 1}^n k^2 + \displaystyle \sum_{k = 1}^n k \right) \\ \\ &= \ \ \dfrac{1}{2} \left( \dfrac{n(n + 1)(2n + 1)}{6} + \dfrac{n(n + 1)}{2} \right) \\ \\ &= \ \ \dfrac{n(n + 1)}{2} \left( \dfrac{2n + 1}{6} + \dfrac{1}{2} \right) \\ \\ &= \ \ \dfrac{n(n + 1)(n + 2)}{6} \end{array}

So we are seeking two sets of ( m , n ) (m, n) such that S P m + T P n SP_m + TP_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 ) (m, n) : ( 1 , 19 ) , ( 2 , 8 ) (1, 19), (2, 8) and ( 16 , 24 ) (16, 24)

We discard the first as m = 1 m = 1 would be a single coin and not qualify as a pyramid.

This leaves S P 2 + T P 8 = 125 = 5 3 SP_2 + TP_8 = 125 = 5^3 and S P 16 + T P 24 = 4096 = 1 6 3 SP_{16} + TP_{24} = 4096 = 16^3 , so the amount spent was 4096 125 = 3971 4096 - 125 = \boxed{3971}

X X
Jun 26, 2018

4096-125=3971

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...