## Saturday, August 12, 2017

### The matter of squares and rectangles

Being in Oxford and not dedicating some time to browse the local book shops is, imho, a crime. In one of my recent visits I found this recreational maths book "Mathematics and Chess" (Dover Publications, 1997) by Miodrag Petković. The very first problem in this book is:

Prove that the total number of rectangles that can be found on a generalized $n \times n$ board is a perfect square of a natural number.

You know, those squares from job interviews and puzzles? Yes, those! So this almost popular matter needs to be sorted out. I will skip the proofs, since almost everything is on Wikipedia these days and the proofs aren't complicated, simple applications of induction. The formula for rectangles is simply beautiful: $$\sum_{k=1}^{n} k^3=\left ( \sum_{k=1}^{n} k \right )^2=\left [ \frac{n(n+1)}{2} \right ]^2$$ Squares and cubes, amazing, isn't it?

While the formula for squares is simply: $$\sum_{k=1}^{n} k^2=\frac{n(n+1)(2n+1)}{6}$$