Squares in A Square
A common mathematical puzzle involves finding the number of squares in a large n by n square grid. This number can be derived as follows:
- The number of 1×1 boxes found in the grid is .
- The number of 2×2 boxes found in the grid is . These can be counted by counting all of the possible upper-left corners of 2×2 boxes.
- The number of k×k boxes (1 ≤ k ≤ n) found in the grid is . These can be counted by counting all of the possible upper-left corners of k×k boxes.
It follows that the number of squares in an n by n square grid is:
That is, the solution to the puzzle is given by the square pyramidal numbers.
The number of rectangles in a square grid is given by the squared triangular numbers.
Read more about this topic: Square Pyramidal Number
Famous quotes containing the words squares and/or square:
“An afternoon of nurses and rumours;
The provinces of his body revolted,
The squares of his mind were empty,
Silence invaded the suburbs,”
—W.H. (Wystan Hugh)
“After the planet becomes theirs, many millions of years will have to pass before a beetle particularly loved by God, at the end of its calculations will find written on a sheet of paper in letters of fire that energy is equal to the mass multiplied by the square of the velocity of light. The new kings of the world will live tranquilly for a long time, confining themselves to devouring each other and being parasites among each other on a cottage industry scale.”
—Primo Levi (19191987)