Squares on a chessboard, tilted ones included

Mark the 81 corner points of the cells of a standard 8×88\times8 chessboard (a 9×99\times9 grid of points). How many squares - of any size and any orientation, tilted ones included - have all four vertices on these points?

Show hints (2)+
  1. Every lattice square fits snugly inside an axis-aligned s×ss\times s box, with one vertex on each side of the box.
  2. Each such box holds exactly ss squares, and there are (9−s)2(9-s)^2 boxes. Sum s(9−s)2s(9-s)^2 for s=1..8s = 1..8.

Answer

Reveal answer →

540

Create a free account to see the full worked solution and track your progress.

Interview format: Trading Aptitude Tests, Systematic & Data-Driven Trading

Related questions