How to find number of squares in a chess board Problem : 
An $ n\times n$ chess board is a square of side $n$ units which has been sub-divided into $n^2$ unit squares by equally spaced straight lines parallel to the sides. Find the total number of squares of all sizes on an $n \times n$  chess board. 
I have been trying to study the pattern of this how to derive the following : 
Answer : $1^2+2^2+\dots+n^2$
Please help .. thanks...
 A: The number of $1 \times 1$ squares is $n^2$ because there are $n^2$ places to put the upper left corner.  The grid is $(n+1) \times (n+1)$ (including the edges) but you can't use the bottom edge or the right edge.  For a $2 \times 2$ square, the upper left corner can be in $(n-1) \times (n-1)$ locations, a $3 \times 3$ square can have the upper left corner in $(n-2) \times (n-2)$ locations $\dots$
Added:  Let us take an $5 \times 5$ board to be specific and number the locations from $(0,0)$ in the upper left to $(5,5)$ in the lower right.  There are $5^2 \  1 \times 1$ squares.  Each one can have its upper left corner in positions $(0,0)$ through $(4,4)$.  There are $4^2 \ 2 \times 2$ squares, because the upper left corner can be $(0,0)$ through $(3,3)$, $3^2 \ 3 \times 3$ squares, because the upper left corner can be $(0,0)$ through $(2,2)$, on to $1^2 \ 5 \times 5$ square, because it has only one location it can fit.  This gives a total number of squares of $5^2+4^2+3^2+2^2+1^2$ as desired.
