One can ask how many identical blocks would be needed to create a pyramid. Suppose there is one block at the very top, four block blocks beneath it, nine blocks in the third row down, etc. To get the total number one needs to know the sum of a series of square numbers. If one considers a series of sums, a particular sum is equal to the prior sum plus k².
The sum of n 1s is n. The sum of 1 through n is n(n+1)/2. So it would seem likely that the sum we are looking for is some cubic expression and by substituting k-1 for k we get the prior sum and the difference.
We can equate the coefficients of k on both sides of the second equals sign to obtain equations for the coefficients.
Note that only unit fractions are needed for the sum. Finally we deduce the formula for the total number of blocks in a pyramid of n rows.
If we assume that the blocks are square in shape with width w and height h the volume of the pyramid is
V = n(n+1)(2n+1)w²h/6.
If we ignore the additive constants and set W = nw and H = nh we get the usual formula for the volume of a pyramid,
V = W²H/3.
A method for computing the volume of a truncated pyramid if found in the Moscow Mathematical Papyrus.
It is not necessary that all the scribes knew this rudimentary level of geometry and algebra. It would take only one master of sufficient skill to deduce the methods of calculation. The builder of the first Step Pyramid was known as Imhotep. He was immortalized by the ancient Egyptians.
It could be that the pyramids contained the mathematical knowledge of the ancient Egyptians. It is not unlikely that they would set this knowledge down in stone. At least the pyramids provided an opportunity to do so.