47. a) How many different squares, in terms of size or position, consisting of whole cells, can be drawn on a chessboard of 64 cells?

b) The same question for a chessboard of $n^{2}$ cells.
47. a) This problem is close to the previous one. The number of all possible squares consisting of $k^{2}$ cells that can be chosen on a chessboard of 64 cells is $(9-k)^{2}$ (see the solution to problem 46 a)). From this, it follows that the number of all squares is $8^{2}+7^{2}+6^{2}+\ldots+1^{2}=$

$$
=64+49+36+25+16+9+4+1=204
$$

b) Similarly to the solution of part a), we conclude that the desired number is

$$
1^{2}+2^{2}+3^{2}+\cdots+n^{2}=\frac{n(n+1)(2 n+1)}{6}
$$

(see, for example, the formula derived in the footnote on page 179; this formula differs from the one we need only by replacing $n$ with $n-1$).

Note. Since by a well-known formula (this formula is not difficult to derive using mathematical induction or prove similarly to the footnote on page $179^{11}$ ))

$$
1^{3}+2^{3}+3^{3}+\ldots+n^{3}=\left(\frac{n(n+1)}{2}\right)^{2}
$$

the results of parts a) and b) can be given the following symmetric form:

The number of different squares consisting of an integer number of cells that can be drawn on an $n^{2}$-cell board is

$$
1^{2}+2^{2}+3^{2}+\ldots+n^{2}
$$

the number of different rectangles consisting of an integer number of cells that can be drawn on an $n^{2}$-cell board is

$$
1^{3}+2^{3}+3^{3}+\ldots+n^{3}
$$