I proposed the following problem for the December 2013 USA IMO TST earlier this month:
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 any 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 a fixed perfect square).
Note that this can also be rephrased in terms of difference quotients of the partial sums. Actually, the original wording was
Find all functions $f:\mathbb{Z}^+\to\mathbb{Z}$ such that $\frac{f(m)-f(n)}{m-n}$ is always a perfect square. (This version was inspired by Evan O'Dorney's solution to IMO 2010 Problem 3; the Dropbox comments have more details.)
The official solution can be found on Dropbox (none of the test takers found anything substantially different). While I think it's amusing how much structure the local approach (working with quadratic (non)residues modulo primes $p$) gives, I also feel the problem conditions are way stronger than necessary.
Does anyone have ideas for the following harder variants? (I'm pretty sure the Dropbox solution fails completely for all of these.)
Are there constants $N,K>0$ such that any sequence of integers $a_1,a_2,\ldots,a_N$ with square consecutive averages for $k=1,2,\ldots,K$ must be constant? (Of course, we might as well take $K=N$ here.)
("$N=\infty$" in (1), so strictly easier than (1).) Is there $K>0$ such that any sequence of integers $a_1,a_2,\ldots$ with square consecutive averages for $k=1,2,\ldots,K$ must be constant?
(More generally, we can ask for which pairs $(L,K)$ the averages condition for $L\le k\le K$ suffices. But this might not be as interesting, since if the $(1,M)$ version holds, then the $(L,LM)$ version already implies $a_i = a_{i+L}$ for all $i\ge1$.)
Note that for $r\ge3$, (1) and (2) are both "yes" (for just $K=2$) for the corresponding problem on $r$th powers. This follows directly from a result of Darmon and Merel: no three distinct $r$th powers form an arithmetic progression ("Main Theorem 1" on page 2).