Problem #73 MEDIUM
The Chessboard Squares
Apple Adobe Combinatorics Math
Problem Statement
A standard chessboard has 64 squares arranged in an 8×8 grid. How many squares in total can be identified on a standard chessboard — counting not just the 64 individual unit squares, but also all possible larger squares formed by combining adjacent cells? Generalise your answer for an n×n grid.
Answer & Quick Explanation
Think you've got it? Click below to check your answer.
204 total squares on a standard 8×8 chessboard: 64 (1×1) + 49 (2×2) + 36 (3×3) + 25 (4×4) + 16 (5×5) + 9 (6×6) + 4 (7×7) + 1 (8×8). General formula for n×n board: n(n+1)(2n+1)/6.
Detailed Editorial Solution
Want to see the step-by-step breakdown? Click below to reveal the editorial.
A square of side length k requires k consecutive rows and k consecutive columns. Its top-left corner can occupy any row from 1 to (n-k+1) and any column from 1 to (n-k+1), giving (n-k+1)² placements for each k.
Step 1: Count 1×1 squares: top-left corner can be at any of 8×8 = 64 positions. Count: 64.
Step 2: Count 2×2 squares: top-left at any of 7×7 = 49 positions. Count: 49.
Step 3: Count 3×3 squares: 6×6 = 36. Count 4×4: 5×5 = 25. Count 5×5: 4×4 = 16. Count 6×6: 3×3 = 9. Count 7×7: 2×2 = 4. Count 8×8: 1×1 = 1.
Step 4: Total = 64+49+36+25+16+9+4+1 = 204.
Step 5: Recognise the pattern: this is the sum of squares from 1² to 8². The formula for the sum of squares 1²+2²+...+n² = n(n+1)(2n+1)/6.
Step 6: For n=8: 8×9×17/6 = 1224/6 = 204. Confirmed. General formula for n×n chessboard: n(n+1)(2n+1)/6 total squares.
Key Insight:
The problem reduces to summing (n-k+1)² for k from 1 to n, which is the same as summing m² for m from 1 to n. The closed-form sum of squares n(n+1)(2n+1)/6 is one of the most useful identities in combinatorics and appears in problems about areas, sums of series, and counting geometric shapes.