Building with Bricks
Enviado por Dimanka, 18/05/2012 - 05:58
To solve the problem we can use a pyramid with H={1, 2,3} and then we see that the amount of bricks needed to build a pyramid with height H is equal to H2.
Mathemathical proof:
f(1) = 1;
f(x) = f(x-1) + 2*x - 1 for x > 1
Where f(x) is number of bricks needed to build the pyramid with height x.
x2- (x-1)2= (x-(x-1))*(x+(x-1)) = 2*x - 1;
f(1) = 1 = 12, then f(2) = (2-1)2+ 2*x - 1 = 4 = 22, so f(x) = x2
So f(5) = 25 and f(10) = 100
(2 votos)
- Se logue ou se registre para poder enviar comentários
Enviar por e-mail


