S is a (k+1)×(k+1) array of lattice points. How many squares have their vertices in S?
Solution
The key is to consider how many squares have their vertices on the perimeter of a given (n+1)×(n+1) array whose sides are parallel to the sides of the array.
The diagram shows that there are n such squares. There are (k+1−n)2 such arrays. So the total number of squares is k⋅12+(k−1)2⋅2+⋯+1⋅k2=∑1k(k+1−i)i2=6(k+1)k(k+1)(2k+1)−4k2(k+1)2=12k(k+1)2(k+2).
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: MathNet,
licensed CC-BY-4.0.
Statement and solution reproduced as published; topic and difficulty added by this site.