On an 8×8 chessboard, how many squares of all sizes — from 1×1 up to 8×8 — are…

2024

On an 8×8 chessboard, how many squares of all sizes — from 1×1 up to 8×8 — are there in total?

  1. A.

    435

  2. B.

    245

  3. C.

    204

  4. D.

    208

Show answer & explanation

Correct answer: C

Concept: In an n×n grid, a k×k square (side length k) can be placed in (n − k + 1) positions along each dimension, so there are (n − k + 1)2 squares of that size. Summing over every size k = 1 to n gives the total count: 12 + 22 + ... + n2 = n(n + 1)(2n + 1) / 6.

  1. Size 1×1: (8 − 1 + 1)2 = 82 = 64 squares

  2. Size 2×2: 72 = 49 squares

  3. Size 3×3: 62 = 36 squares

  4. Size 4×4: 52 = 25 squares

  5. Size 5×5: 42 = 16 squares

  6. Size 6×6: 32 = 9 squares

  7. Size 7×7: 22 = 4 squares

  8. Size 8×8: 12 = 1 square

  9. Total: 64 + 49 + 36 + 25 + 16 + 9 + 4 + 1 = 204

Cross-check with the closed-form formula: for n = 8, n(n + 1)(2n + 1)/6 = 8 × 9 × 17 / 6 = 1224/6 = 204, which matches the direct count above.

Explore the full course: Tcs Live Preparation