Maths Olympiad Prep

Library / /17 of 22

Number theory Difficulty 8.7 Shortlist Prove it United States

Let a1,a2,a3,a_1, a_2, a_3, \dots be a sequence of integers, with the property that every consecutive group of aia_i's averages to a perfect square. More precisely, for every positive integers nn and kk, the quantity
an+an+1++an+k1k \frac{a_n + a_{n+1} + \dots + a_{n+k-1}}{k}
is always the square of an integer. Prove that the sequence must be constant (all aia_i are equal to the same perfect square).

Solutions — 3

Solution 1

We prove the following equivalent statement: we show that if f:NZf : \mathbb{N} \to \mathbb{Z} is a function such that (f(m)f(n))(mn)(f(m) - f(n))(m - n) is always the square of an integer, then ff must be of the form A2x+BA^2x + B for integers A,BA, B. First, since p(f(n+p)f(n))p(f(n + p) - f(n)) is a square for any prime pp and positive integer nn, pp must divide f(n+p)f(n)f(n + p) - f(n). (Similarly, we may prove pkf(n+pk)f(n)p^k \mid f(n + p^k) - f(n) by induction, but we will not need to do so.)

Lemma. If pf(a)f(b)p \mid f(a) - f(b) but pabp \nmid a - b for some a,ba, b, then pf(m)f(n)p \mid f(m) - f(n) for all m,nm, n. (In other words, ff is either injective or constant modulo pp.)
Proof. For each integer rr, define Sr={x:f(x)r(modp)}S_r = \{x : f(x) \equiv r \pmod{p}\}, which must be a union of residue classes modulo pp (restricted to the positive integers). Then we need to show that either (1) for every rr, SrS_r covers at most one residue class (and thus exactly one), or (2) for some rr, SrS_r covers all residue classes.

Suppose otherwise; then there exists rr such that S=SrS = S_r covers between 2 and p1p-1 residues (so p3p \ge 3). If nSn \notin S (i.e. f(n)≢r(modp)f(n) \not\equiv r \pmod p), then for any sSs \in S,
(ns)(f(n)f(s))(ns)(f(n)r)≢0(modp) (n-s)(f(n)-f(s)) \equiv (n-s)(f(n)-r) \not\equiv 0 \pmod{p}
is a nonzero quadratic residue. Hence (nsp)=(f(n)rp)0\left(\frac{n-s}{p}\right) = \left(\frac{f(n)-r}{p}\right) \neq 0.
Now let T={t:(f(t)rp)=1}T = \{t : \left(\frac{f(t)-r}{p}\right) = 1\} and U={u:(f(u)rp)=1}U = \{u : \left(\frac{f(u)-r}{p}\right) = -1\}, so T,UT, U partition NS\mathbb{N} \setminus S. By the previous paragraph, (ap)=1\left(\frac{a}{p}\right) = 1 for any a=tsa = t-s in the difference set TST-S; similarly, (bp)=1\left(\frac{b}{p}\right) = -1 for any bUSb \in U-S. This immediately upper bounds TS|T-S| and US|U-S| by p12\frac{p-1}{2}, the number of (nonzero) quadratic residues and nonresidues.
But T+U=pS1|T| + |U| = p - |S| \ge 1, so if TU|T| \ge |U| (so TT is nonempty), then Cauchy-Davenport yields
p12TSmin(p,T+S1)min(p,pS2+S1)=min(p,p+(S2)2), \frac{p-1}{2} \ge |T-S| \ge \min(p, |T| + |S| - 1) \ge \min\left(p, \frac{p-|S|}{2} + |S| - 1\right) = \min\left(p, \frac{p + (|S| - 2)}{2}\right),
contradicting S2|S| \ge 2. The case UT|U| \ge |T| is analogous. \square

Note that f(n+1)f(n)f(n+1) - f(n) is always a square. If ff is nonconstant, gcdn1(f(n+1)f(n))0\gcd_{n \ge 1}(f(n+1) - f(n)) \ne 0 must be a square itself (say g2g^2, with g>0g > 0). If g=1g=1, then ff is nonconstant (and thus injective, by the lemma) modulo every prime pp. In particular, pf(n+1)f(n)p \nmid f(n+1) - f(n) for all nn and pp, which forces f(x+1)f(x)1    f(x)x+df(x+1) - f(x) \equiv 1 \implies f(x) \equiv x+d for some constant dd. Otherwise, if g>1g > 1, f(x)f(x)f(1)g2f'(x) \equiv \frac{f(x)-f(1)}{g^2} has (f(m)f(n))(mn)(f'(m) - f'(n))(m-n) always a square and gcdn1(f(n+1)f(n))=1\gcd_{n \ge 1}(f'(n+1) - f'(n)) = 1, so f(x)g2(x+d)+cf(x) \equiv g^2(x+d) + c for some constants d,cd, c.

It follows that f(x)A2x+Bf(x) \equiv A^2x + B (A,BZA, B \in \mathbb{Z}) are the only possible solutions, which indeed all work (note that we get ff constant when A=0A=0).

Solution 2

We give an alternate proof of the lemma. Define rr and S=SrS = S_r as in the previous proof.
Since p3p \ge 3, there exists a smallest quadratic nonresidue α[2,p1]\alpha \in [2, p-1] modulo pp. In particular, α1[1,p2]\alpha-1 \in [1, p-2] is a quadratic residue. Now fix two distinct residues x,yx, y (mod pp) in SS. We claim that for N=x+α(yx)N = x+\alpha(y-x), we have f(N)r(modp)f(N) \equiv r \pmod p. Suppose otherwise; then f(N)≢rf(x)f(y)f(N) \not\equiv r \equiv f(x) \equiv f(y). But then [f(N)f(x)][Nx][f(N)r]α(yx)[f(N)-f(x)][N-x] \equiv [f(N)-r]\alpha(y-x) and [f(N)f(y)][Ny][f(N)r](α1)(yx)[f(N)-f(y)][N-y] \equiv [f(N)-r](\alpha-1)(y-x) must both be nonzero squares, forcing (αp)=(α1p)\left(\frac{\alpha}{p}\right) = \left(\frac{\alpha-1}{p}\right), which is absurd.
Hence x+α(yx)=(1α)x+αyx+\alpha(y-x) = (1-\alpha)x + \alpha y lies in SS (interpret relations modulo pp where clearly appropriate) for any distinct residues x,ySx, y \in S; of course, it also does when xySx \equiv y \in S. This condition is affine, so for convenience, fix distinct residues a,bSa, b \in S and define A=(Sa)(ba)1A = (S-a)(b-a)^{-1}. Then 0,1A0, 1 \in A and we still have (1α)x+αyA(1-\alpha)x + \alpha y \in A whenever x,yAx, y \in A.
By plugging in x0x \equiv 0, we get αAA\alpha A \subseteq A, and from y0y \equiv 0, we get (1α)AA(1-\alpha)A \subseteq A. Therefore (noting that pα,1αp \nmid \alpha, 1-\alpha)
A+A(1α)(1α)p2A+ααp2A(1α)A+αAA, A + A \equiv (1-\alpha)(1-\alpha)^{p-2}A + \alpha\alpha^{p-2}A \subseteq (1-\alpha)A + \alpha A \subseteq A,
so A+1A    A=Z/pZ    S=Z/pZA+1 \subseteq A \implies A = \mathbb{Z}/p\mathbb{Z} \implies S = \mathbb{Z}/p\mathbb{Z}, as desired.

Solution 3

We present yet another proof of the lemma. The previous proof shows that if x,ySx, y \in S, then x+α(yx)Sx + \alpha(y-x) \in S. We claim that N=x+(α+1)(yx)N = x + (\alpha+1)(y-x) lies in SS as well. Indeed, the only way [f(N)f(y)][Ny][f(N)r]α(yx)[f(N)-f(y)][N-y] \equiv [f(N)-r]\alpha(y-x) and [f(N)f(x+α(yx))][N(x+α(yx))][f(N)r](yx)[f(N)-f(x+\alpha(y-x))][N-(x+\alpha(y-x))] \equiv [f(N)-r](y-x) can both be quadratic residues is if pf(N)rp \mid f(N)-r, so NSN \in S.
But [x+(α+1)(yx)][x+α(yx)]=yx[x+(\alpha+1)(y-x)] - [x+\alpha(y-x)] = y-x, so we conclude that x+kα(yx)x+k\alpha(y-x) and x+k(α+1)(yx)x+k(\alpha+1)(y-x) lie in SS for all k0k \ge 0. Since pαp \nmid \alpha, x+kα(yx)x+k\alpha(y-x) covers all residues modulo pp, so S=Z/pZS = \mathbb{Z}/p\mathbb{Z}, as desired.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.