# Connect the dots!

How many distinct squares can be formed by connecting dots in the diagram above?

As a bonus, can you generalize to an $$n \times n$$ lattice, or a $$n \times m$$ lattice?

Inspired by Maria Kozlowska's similar problem, called "Triangles on a Christmas tree".

×