2
$\begingroup$

Recently came a across a question about calculating the number of squares in 8x8 chessboard. Being not that good in maths my answer was 64 but to my surprise it was 204.So how is it?And how to go about calculating number of squares in $n\times n$ chessboard??

  • 1
    They are considering "squares" that are 1x1, 2x2, ..., up to 8x8. With this in mind, maybe you could come up with a way to calculate how many are in an n x n chessboard.2012-03-06

2 Answers 2

3

The number of squares on an $n \times n$ chessboard is $$\dfrac{n(n+1)(2n + 1)}{6}$$

  • 0
    I was kinda hoping that this answer would generate some discussion with the OP... or at least a "I see how you deduced that" ...2012-03-06
  • 5
    well thnks @The Chaz. i got the answer from your hint.Taking 1 square at a time we have 8*8 squares in total,taking 2 squares at a time we have 7*7 squares in total,taking 3 squares at a time we have 6*6 squares in total and so on taking 8 squares at a time we have 1*1 square.so finally what we get is 8^2+7^2+6^2+5^2+4^2+3^2+2^1+1^1 which is sum of squares from 1 to 8 and putting it in general we get your expression.2012-03-06
  • 1
    Exactly! Good work.2012-03-06
3

There are indeed exactly $n^2$ instances of $1\times1$ squares. However, there are also $m\times m$ squares for all $1\le m\le n\;$ on the chessboard! Now any $m\times m\;$ square's position on the board is determined by the location of its upper leftmost square. So, working locally (i.e. for a given number $m$), how many squares are on the board with at least $m-1$ squares both to the right of it and below it?