Problem

Source: USA December TST for IMO 2014, Problem 2

Tags: quadratics, USA(J)MO, USAMO, induction, modular arithmetic, number theory proposed, Quadratic Residues



Let $a_1,a_2,a_3,\ldots$ be a sequence of integers, with the property that every consecutive group of $a_i$'s averages to a perfect square. More precisely, for every positive integers $n$ and $k$, the quantity \[\frac{a_n+a_{n+1}+\cdots+a_{n+k-1}}{k}\] is always the square of an integer. Prove that the sequence must be constant (all $a_i$ are equal to the same perfect square). Evan O'Dorney and Victor Wang