Denote by Z2 the set of all points (x,y) in the plane with integer coordinates. For each integer n≥0, let Pn be the subset of Z2 consisting of the point (0,0) together with all points (x,y) such that x2+y2=2k for some integer k≤n. Determine, as a function of n, the number of four-point subsets of Pn whose elements are the vertices of a square.
A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.
We first determine the set Pn. Let Qn be the set of points in Z2 of the form (0,±2k) or (±2k,0) for some k≤n. Let Rn be the set of points in Z2 of the form (±2k,±2k) for some k≤n (the two signs being chosen independently). We prove by induction on n that Pn={(0,0)}∪Q⌊n/2⌋∪R⌊(n−1)/2⌋. We take as base cases the straightforward computations P0P1={(0,0),(±1,0),(0,±1)}=P0∪{(±1,±1)}. For n≥2, it is clear that {(0,0)}∪Q⌊n/2⌋∪R⌊(n−1)/2⌋⊆Pn, so it remains to prove the reverse inclusion. For (x,y)∈Pn, note that x2+y2≡0(mod4); since every perfect square is congruent to either 0 or 1 modulo 4, x and y must both be even. Consequently, (x/2,y/2)∈Pn−2, so we may appeal to the induction hypothesis to conclude.
We next identify all of the squares with vertices in Pn. In the following discussion, let (a,b) and (c,d) be two opposite vertices of a square, so that the other two vertices are (2a−b+c+d,2a+b−c+d) and (2a+b+c−d,2−a+b+c+d).
Suppose that (a,b)=(0,0). Then (c,d) may be any element of Pn not contained in P0. The number of such squares is 4n.
Suppose that (a,b),(c,d)∈Qk for some k. There is one such square with vertices {(0,2k),(0,2−k),(2k,0),(2−k,0)} for k=0,…,⌊2n⌋, for a total of ⌊2n⌋+1. To show that there are no others, by symmetry it suffices to rule out the existence of a square with opposite vertices (a,0) and (c,0) where a>∣c∣. The other two vertices of this square would be ((a+c)/2,(a−c)/2) and ((a+c)/2,(−a+c)/2). These cannot belong to any Qk, or be equal to (0,0), because ∣a+c∣,∣a−c∣≥a−∣c∣>0 by the triangle inequality. These also cannot belong to any Rk because (a+∣c∣)/2>(a−∣c∣)/2. (One can also phrase this argument in geometric terms.)
Suppose that (a,b),(c,d)∈Rk for some k. There is one such square with vertices {(2k,2k),(2k,−2k),(−2k,2k),(−2k,−2k)} for k=0,…,⌊2n−1⌋, for a total of ⌊2n+1⌋. To show that there are no others, we may reduce to the previous case: rotating by an angle of 4π and then rescaling by a factor of 2 would yield a square with two opposite vertices in some Qk not centered at (0,0), which we have already ruled out.
It remains to show that we cannot have (a,b)∈Qk and (c,d)∈Rk for some k. By symmetry, we may reduce to the case where (a,b)=(0,2k) and (c,d)=(2ℓ,±2ℓ). If d>0, then the third vertex (2k−1,2k−1+2ℓ) is impossible. If d<0, then the third vertex (−2k−1,2k−1−2ℓ) is impossible.
Summing up, we obtain 4n+⌊2n⌋+1+⌊2n+1⌋=5n+1 squares, proving the claim.
Source: Omni-MATH,
licensed Apache-2.0.
Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.