A 30x30x30 cube is made by gluing together 30
^{3}=27000 unit cubes. A
square pyramid having each side of the base as 30 units and, height from base to the apex of the pyramid as 30 units is cut out of the cube by means of an infinitely thin laserlike cutting tool.
How many unit cubes will stay undamaged inside the pyramid?
Note: The apex of the pyramid is located perpendicularly above the center of the square base.
The base of the pyramid is as mentioned a square of side length 30.
One unit up, the horizontal crosssection has side length 29, etc., so that at the top the crosssectional "side length" is zero.
At a side length of 29, the square cross section extends 14.5 units above, below and to each side of center. This prevents the outer square ring of cubic blocks on the bottom level from being undamaged and contained within the pyramid, so the first level has 28*28 blocks.
At the plane 2 units from the ground, the pyramid's crosssection is 28x28. This allows the second level of cubic blocks also to contain 28*28 blocks.
Overall then, the count of the set of undamaged blocks completely within the pyramid is 2*(28*28 + 26*26 + 24*24 + ... + 2*2 + 0*0). The last two 0x0's result from the top cap of the pyramid consisting of small pieces of four cubic blocks and the second layer from the top consisting of larger pieces of four cubic blocks, as the horizontal plane one unit from the top is only 1x1 and cuts through the centers of the top faces of the four blocks in the center of the second layer from the top.
This comes out to 8120. As a check, this comes in under the 9000 cubicunit volume of the pyramid, with the missing volume being that of the partial blocks included within the pyramid.
DEFDBL AZ
FOR i = 0 TO 28 STEP 2
t = t + i * i
NEXT
PRINT 2 * t
8120

Posted by Charlie
on 20100602 14:12:35 