Friday, 12 June 2015

mathematics - Total no of squares on a Chess Board


Is there any formula than calculates the total number of squares on chessboard?


For example in a $8\times8$ chessboard, there are squares of sizes $1\times1$, $2\times2$, $\ldots$, $8\times8$.


So I want to know their total number. Is there a general formula for a $n\times n$ chessboard?



Answer



There are




$1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2 + 7^2 + 8^2 = 204$ squares on an $8\times8$ board.
In the general case, the number of squares is $1^2 + \dots + n^2$ for an $n\times n$ board,
or equivalently, $\rlap{\raise{2.5ex}{~\scriptsize ~n}}{\rlap{\lower{2ex}{\scriptsize{k\text{=1}}}}{\large{\sum}~k^2}}$.

As @M Oehm noted, a Faulhaber formula lets us simplify this to $\large ~~\frac{n(n+1)(2n+1)}6$.



This is because ...



For $1\times1$ squares, there are obviously $n^2$ of them.
You can fit $(n-1)$ rows of $2\times2$ squares in an $n^2$ area, and each row has $(n-1)$ in it.
You can fit $(n-2)$ rows of $3\times3$ squares in an $n^2$ area, and each row has $(n-2)$ in it.

...
You can fit $2$ rows of $(n-1)\times(n-1)$ squares in an $n^2$ area, and each row has $2$ in it.
And finally, of course, you can fit 1 $(n\times n)$ square in an $n^2$ area.

This expands to
$n^2 + (n-1)^2 + \dots + 2^2 + 1^2 = \rlap{\raise{2.5ex}{~\scriptsize ~n}}{\rlap{\lower{2ex}{\scriptsize{k\text{=1}}}}{\large{\sum}~k^2}} = \large ~~\frac{n(n+1)(2n+1)}6$.



No comments:

Post a Comment