Maths Olympiad Prep

Library / HMMT November /527 of 672

HMMT November, 2015

Number theory Difficulty 5.3 AIME, harder Prove it United States

Problem:
A number nn is bad if there exists some integer cc for which xx≡c(modn)x^{x} \equiv c \pmod{n} has no integer solutions for xx. Find the number of bad integers between 22 and 4242 inclusive.

Solution

Solution:
Call a number good if it is not bad. We claim all good numbers are products of distinct primes, none of which are equivalent to 11 modulo another.

We first show that all such numbers are good. Consider n=p1p2…pkn = p_{1} p_{2} \ldots p_{k}, and let xx be a number satisfying x≡c(modp1p2…pk)x \equiv c \pmod{p_{1} p_{2} \ldots p_{k}} and x≡1(mod(p1−1)(p2−1)…(pk−1))x \equiv 1 \pmod{(p_{1}-1)(p_{2}-1) \ldots (p_{k}-1)}. Since, by assumption, p1p2…pkp_{1} p_{2} \ldots p_{k} and (p1−1)(p2−1)…(pk−1)(p_{1}-1)(p_{2}-1) \ldots (p_{k}-1) are relatively prime, such an xx must exist by CRT. Then xx≡c1=c(modn)x^{x} \equiv c^{1} = c \pmod{n}, for any cc, as desired.

We now show that all other numbers are bad. Suppose that there exist some p1,p2∣np_{1}, p_{2} \mid n such that gcd⁡(p1,p2−1)≠1\gcd(p_{1}, p_{2}-1) \neq 1 (which must hold for some two primes by assumption), and hence gcd⁡(p1,p2−1)=p1\gcd(p_{1}, p_{2}-1) = p_{1}. Consider some cc for which p1cp_{1} c is not a p1p_{1}th power modulo p2p_{2}, which must exist as p1cp_{1} c can take any value modulo p2p_{2} (as p1,p2p_{1}, p_{2} are relatively prime). We then claim that xx≡p1c(modn)x^{x} \equiv p_{1} c \pmod{n} is not solvable.

Since p1p2∣np_{1} p_{2} \mid n, we have xx≡p1c(modp1p2)x^{x} \equiv p_{1} c \pmod{p_{1} p_{2}}, hence p1∣xp_{1} \mid x. But then xx≡p1cx^{x} \equiv p_{1} c is a p1p_{1}th power modulo p2p_{2} as p1∣xp_{1} \mid x, contradicting our choice of cc. As a result, all such numbers are bad.

Finally, it is easy to see that nn is bad if it is not squarefree. If p1p_{1} divides nn twice, then letting c=p1c = p_{1} makes the given equivalence unsolvable.

Hence, there are 1616 numbers (13 primes: 2,3,5,7,11,13,17,19,23,29,31,37,412, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41; and 3 semiprimes: 3⋅5=153 \cdot 5 = 15, 3⋅11=333 \cdot 11 = 33, 5⋅7=355 \cdot 7 = 35) that are good, which means that 41−16=2541 - 16 = 25 numbers are bad.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

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