Maths Olympiad Prep

Track / Stage 8 / 176 of 180 #2356 of 2444

Problem 2356

IMO Shortlist mid-range; USAMO P2/P5
Combinatorics Difficulty 8.9 Prove it IMO Selection · Switzerland

For each prime pp, somewhere in the multiverse there exists a kingdom consisting of pp islands numbered from 11 to pp with a bridge between any pair of them. When Jana visits a kingdom, coronavirus restrictions mean she must obey the following rule: Directly after visiting island mm, she can only cross over to island nn if
p(m2n+1)(n2m+1) p \mid (m^{2}-n+1)(n^{2}-m+1)
Show that there are infinitely many kingdoms such that Jana cannot travel to every island in this manner.

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

Solution:

Note that the divisibility condition is symmetrical in mm and nn. In other words: If Jana can cross over from island mm to island nn, she can also go the other way. Let us define a graph GG as follows: Each of the islands 1,2,,p1,2, \ldots, p represents a vertex and we draw an edge between two vertices mm and nn if and only if
p(m2n+1)(n2m+1) p \mid (m^{2}-n+1)(n^{2}-m+1)
The edges of our graph now exactly represent between which pairs of islands Jana can travel, so it's easy to see that Jana can travel to every island if and only if GG is connected.

This insight motivates us to count the number of edges in GG, because if we can show that there are less than p1p-1 edges, GG has to be disconnected! By the formula
E=12vVdeg(v) |E| = \frac{1}{2} \sum_{v \in V} \operatorname{deg}(v)
it is enough to know the number of vertices of every possible degree. The degree of a fixed vertex mm is the number of distinct n{1,2,,p}n \in \{1,2, \ldots, p\} such that
(m2n+1)(n2m+1)0(modp) (m^{2}-n+1)(n^{2}-m+1) \equiv 0 \pmod{p}
Obviously, there is exactly one choice for nn such that m2n+10(modp)m^{2}-n+1 \equiv 0 \pmod{p}, namely nm2+1n \equiv m^{2}+1. But what about n2m+10(modp)n^{2}-m+1 \equiv 0 \pmod{p}?

Lemma: Let pp be an odd prime and aa some residue modulo pp. Then, x2a0(modp)x^{2}-a \equiv 0 \pmod{p} has
- no solutions in xx for exactly p12\frac{p-1}{2} different values of aa.
- exactly one solution in xx if and only if a=0a=0.
- exactly two solutions in xx for p12\frac{p-1}{2} different values of aa.

Proof of the Lemma: Note that x2y2x^{2} \equiv y^{2} is equivalent to (xy)(x+y)0(x-y)(x+y) \equiv 0 or in other words y±x(modp)y \equiv \pm x \pmod{p}.
Hence, the squares of 1,,p121, \ldots, \frac{p-1}{2} are all distinct modulo pp and they are equal to the squares of p1,,p+12p-1, \ldots, \frac{p+1}{2}, respectively. This gives us p12\frac{p-1}{2} values of aa such that there are two solutions in xx. The only residue left is 00, which gives us a unique choice of aa with exactly one solution in xx. The remaining p12\frac{p-1}{2} values of aa therefore admit no solutions at all.

By letting a=m1a = m-1, the Lemma tells us that there are p12\frac{p-1}{2} different mm with two solutions in nn. If we assume that the conditions n2m+10(modp)n^{2}-m+1 \equiv 0 \pmod{p} and m2n+10(modp)m^{2}-n+1 \equiv 0 \pmod{p} are never satisfied at the same time (or for m=nm=n), we would get
E=12vVdeg(v)=12(p121+12+p123)=p |E| = \frac{1}{2} \sum_{v \in V} \operatorname{deg}(v) = \frac{1}{2} \cdot \left(\frac{p-1}{2} \cdot 1 + 1 \cdot 2 + \frac{p-1}{2} \cdot 3\right) = p
Sadly, this is not small enough! We need to reduce the number of edges a bit more. The easiest way of doing this is by assuming that there exists a residue mm such that m2m+10(modp)m^{2}-m+1 \equiv 0 \pmod{p}. This corresponds to a loop in GG (an edge going from mm to itself), which is irrelevant for the connectivity of GG. A short calculation inspired by Vieta shows that m2m+10(modp)m^{2}-m+1 \equiv 0 \pmod{p} implies (1m)2(1m)+10(modp)(1-m)^{2}-(1-m)+1 \equiv 0 \pmod{p}, so as long as m≢1m(modp)m \not\equiv 1-m \pmod{p}, we have two loops, from which we conclude that GG is disconnected.

Let us now prove that there are infinitely many primes pp such that there exists a residue mm satisfying m2m+10(modp)m^{2}-m+1 \equiv 0 \pmod{p}: Let mm be the product of the first kk primes and let pp be a prime factor of m2m+1m^{2}-m+1. In particular, pp is not equal to the first kk primes and so there are infinitely many such pp. If m1m(modp)m \equiv 1-m \pmod{p} then mp+12(modp)m \equiv \frac{p+1}{2} \pmod{p}. However, in this case we must have
(p+12)2p+12+1=p2+340(modp) \left(\frac{p+1}{2}\right)^{2} - \frac{p+1}{2} + 1 = \frac{p^{2}+3}{4} \equiv 0 \pmod{p}
which is equivalent to p=3p=3. This shows that for all such p>3p>3 that we constructed, GG is indeed disconnected.

Alternative arguments (inspired by Joel/Mathys): Instead of introducing a simple undirected graph, we introduce a not necessarily simple directed graph where the edge points from mm to nn if pm2n+1p \mid m^{2}-n+1 and from nn to mm if pn2m+1p \mid n^{2}-m+1. The directions are actually completely irrelevant for Jana's travel plans but they allow us to count the edges more elegantly:

For every mm there is exactly one value of nn such that m2n+10(modp)m^{2}-n+1 \equiv 0 \pmod{p}. This means that each of the pp vertices has one edge pointing away from it, and therefore we have pp edges in total.

To show that the graph is not connected, we will explicitly find two vertices of GG which will have loops: Let p1(mod3)p \equiv 1 \pmod{3}, in particular, pp is odd and so p1p-1 is divisible by 66. Take a primitive root aa modulo pp. For m=ap16m = a^{\frac{p-1}{6}} we have
m610(modp)(m2m+1)(m+1)(m31)0(modp)m2m+10(modp) m^{6}-1 \equiv 0 \pmod{p} \Leftrightarrow (m^{2}-m+1)(m+1)(m^{3}-1) \equiv 0 \pmod{p} \Rightarrow m^{2}-m+1 \equiv 0 \pmod{p}
because, since aa is a primitive root, m+1m+1 and m31m^{3}-1 cannot be divisible by pp. But the same calculation can be done with m=a5(p1)6m = a^{\frac{5(p-1)}{6}}, so we found two loops for infinitely many pp (Dirichlet) and we're done!

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