Olympiad Maths Prep

Track / Stage 9 / 33 of 80 #1913 of 2000

Problem 1913

IMO P2/P5; hard shortlist
Number theory Difficulty 9.1 Prove it IMO TST · 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 ms(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=ak1+s(k) for all k1. 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, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

Answer. n=2k1n = 2^k - 1 for any kNk \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+s1+s=r(n+12)+((s1)+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 xx2+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 x12(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=2k1n = 2^k - 1. Then (n+12)=2k1(2k1)=22k12k1(mod22k)\binom{n+1}{2} = 2^{k-1}(2^k - 1) = 2^{2k-1} - 2^{k-1} \pmod{2^{2k}}. Then, if for 0r0 \le r and 1sn1 \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 1s<tn1 \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)(st)(s+t+1)(2n+2) \mid (s-t)(s+t+1), and since s,ts, t have opposite parities and 2n+2>2n+1s+t+1>st>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 and solution reproduced as published; topic, difficulty and ordering added by this site.