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 × n n \times n lattice, or a n × m n \times m lattice?

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


The answer is 50.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Nathan Ramesh
Jun 1, 2015

I evaluated the sum k = 1 n 1 k ( n k ) 2 \sum_{k=1}^{n-1} k(n-k)^2 which evaluates to 1 6 ( n 2 2 ) , \frac{1}{6} \dbinom{n^2}{2}, begging me to believe that there is a nice bijective solution as well.

Cam you explain that solution?

Ashwin Padaki - 6 years ago

@Nathan Ramesh Can you ellaborate?

Anik Mandal - 5 years, 12 months ago

Log in to reply

It is self-explanatory.

Nathan Ramesh - 5 years, 12 months ago

Log in to reply

can you explain JMO winner ?

Ajatshatru Singh - 5 years, 11 months ago

Answer should be 1x1 + 2x2 + 3x3 + 4x4 =30

Ethan Hunt - 5 years, 12 months ago

Log in to reply

No the answer is not 30 you should also count the tilted square it is a dot grid not a square grid hence tilted squares can be obtained.

Abhishek Chopra - 5 years, 11 months ago

Log in to reply

Ya, I counted the answer should be 40.

Ashish Menon - 5 years, 4 months ago
Arjen Vreugdenhil
Sep 29, 2015

There are n x ) ( m x ) n-x)(m-x) ways to pick an orthogonal side with side x x in the grid.

Apart from the square itself, there are x 1 x - 1 tilted squares that fit snugly inside. (Consider the possible locations for a vertex of the tilted square on the left side of the orthogonal square.)

Thus the number of possibilities, assuming that n m n \leq m , is S n m = x = 1 n ( n x ) ( m x ) x . S_{nm} = \sum_{x=1}^n (n-x)(m-x)x. In this case, n = m = 5 n = m = 5 and it is easy to evaluate the sum: S 4 = 4 2 1 + 3 2 2 + 2 2 3 + 1 2 4 = 16 + 18 + 12 + 4 = 50. S_4 = 4^2\cdot 1 + 3^2\cdot 2 + 2^2\cdot 3 + 1^2\cdot 4 = 16 + 18 + 12 + 4 = 50.

More generally, if n = m n = m the sum can be written as S n = 1 12 ( n 1 ) n 2 ( n + 1 ) = 1 6 ( n 2 2 ) . S_n = \tfrac1{12} (n-1)n^2(n+1) = \frac16\left(\begin{array}{c} n^2 \\ 2 \end{array}\right).

Bill Bell
Jun 1, 2015

Brute force but nice. I'm indebted to people on codegolf. The square is invariant under 90-degree rotations about its centre, and multiplication of a point in the complex plane by i amounts to a 90-degree rotation in that plane about the origin. Packaging those facts yields a nice solution.

Here's a good explanation of the general solution .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...