Maths Olympiad Prep

Track / Stage 9 / 1 of 52 #2521 of 2604

Problem 2521

IMO P2/P5; hard shortlist
Number theory Difficulty 9.1 Prove it India — Team Selection Test · India

Let nn be a positive integer. Let s:N→{1,…,n}s: \mathbb{N} \to \{1, \dots, n\} be a function such that nn divides m−s(m)m - s(m) for all positive integers mm. Let a0,a1,a2,…a_0, a_1, a_2, \dots be a sequence such that a0=0a_0 = 0 and
ak=ak−1+s(k) for all k≥1. a_k = a_{k-1} + s(k) \text{ for all } k \ge 1.
Find all nn for which this sequence contains all the residues modulo (n+1)2(n+1)^2.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

Answer. n=2k−1n = 2^k - 1 for any k∈Nk \in \mathbb{N}.

We begin by noting that the sequence is given by the formula
arn+s=r⋅(n+12)+(s+12) a_{rn+s} = r \cdot \binom{n+1}{2} + \binom{s+1}{2}
for all ≥0\ge 0 and s=1,2,…,ns = 1, 2, \dots, n. This is easy to confirm by mathematical induction: a0=0a_0 = 0 is true, and for fixed rr, inducting on ss gives
arn+s=arn+s−1+s=r⋅(n+12)+((s−1)+12)+s=r⋅(n+12)+(s+12), a_{rn+s} = a_{rn+s-1} + s = r \cdot \binom{n+1}{2} + \binom{(s-1)+1}{2} + s = r \cdot \binom{n+1}{2} + \binom{s+1}{2},
proving this induction step. Finally, a(r+1)n=(r+1)(n+12)=r⋅(n+12)+(n+12)=arn+na_{(r+1)n} = (r+1)\binom{n+1}{2} = r \cdot \binom{n+1}{2} + \binom{n+1}{2} = a_{rn+n}, confirming the induction argument on rr as well, proving the claim.

Now suppose n+1n+1 has an odd prime factor pp. Then p∣(n+12)p \mid \binom{n+1}{2}, so if all residues mod (n+1)2(n+1)^2 are present, then (s+12)≡s2+s2(modp)\binom{s+1}{2} \equiv \frac{s^2+s}{2} \pmod{p} covers all possible residues mod pp. However, the map x↦x2+x(modp)x \mapsto x^2+x \pmod{p} sends xx and −(1+x)-(1+x) to the same element mod pp and the two are distinct unless x≡−12(modp)x \equiv \frac{-1}{2} \pmod{p}, hence the set of residues represented by s2+s(modp)s^2+s \pmod{p} has p+12<p\frac{p+1}{2} < p elements, a contradiction! So every nn that satisfies this condition must be one less than a power of 2.

Now we prove that all nn one less than powers of 2 satisfy the condition. Let n=2k−1n = 2^k - 1. Then (n+12)=2k−1(2k−1)=22k−1−2k−1(mod22k)\binom{n+1}{2} = 2^{k-1}(2^k - 1) = 2^{2k-1} - 2^{k-1} \pmod{2^{2k}}. Then, if for 0≤r0 \le r and 1≤s≤n1 \le s \le n, and r=2j+er = 2j + e, where e∈{0,1}e \in \{0, 1\}, then
arn+s=−j⋅(n+1)+e⋅(n+12)+(s+12)(mod(n+1)2). a_{rn+s} = -j \cdot (n+1) + e \cdot \binom{n+1}{2} + \binom{s+1}{2} \pmod{(n+1)^2}.
Notice that for s=1,2,…,ns = 1, 2, \dots, n, the numbers (s+12)\binom{s+1}{2} are all distinct mod n+1n+1. Indeed, if 1≤s<t≤n1 \le s < t \le n and (s+12)=(t+12)(modn+1)\binom{s+1}{2} = \binom{t+1}{2} \pmod{n+1}, then (2n+2)∣(s−t)(s+t+1)(2n+2) \mid (s-t)(s+t+1), and since s,ts, t have opposite parities and 2n+2>2n+1≥s+t+1>∣s−t∣>02n+2 > 2n+1 \ge s+t+1 > |s-t| > 0, we arrive at a contradiction as 2n+22n+2 is a power of 2, proving that the residues are distinct mod n+1n+1. Also, note that none of these residues are 0 (mod n+1n+1). Thus, −j(n+1)+(s+12)-j(n+1) + \binom{s+1}{2} (where e=0e=0) covers all n2+nn^2+n residues which are not of the form l(n+1)(mod(n+1)2)l(n+1) \pmod{(n+1)^2}.

Finally, for the remaining residues, take s=ns = n and e=1e = 1, we get −j(n+1)+2(n+12)=−(j+1)(n+1)(mod(n+1)2)-j(n+1)+2\binom{n+1}{2} = -(j+1)(n+1) \pmod{(n+1)^2}, so that which covers the remaining residues as jj varies. □\square

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.