Maths Olympiad Prep

Library / /586 of 740

, 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 xxc(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=p1p2pkn = p_{1} p_{2} \ldots p_{k}, and let xx be a number satisfying xc(modp1p2pk)x \equiv c \pmod{p_{1} p_{2} \ldots p_{k}} and x1(mod(p11)(p21)(pk1))x \equiv 1 \pmod{(p_{1}-1)(p_{2}-1) \ldots (p_{k}-1)}. Since, by assumption, p1p2pkp_{1} p_{2} \ldots p_{k} and (p11)(p21)(pk1)(p_{1}-1)(p_{2}-1) \ldots (p_{k}-1) are relatively prime, such an xx must exist by CRT. Then xxc1=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,p2np_{1}, p_{2} \mid n such that gcd(p1,p21)1\gcd(p_{1}, p_{2}-1) \neq 1 (which must hold for some two primes by assumption), and hence gcd(p1,p21)=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 xxp1c(modn)x^{x} \equiv p_{1} c \pmod{n} is not solvable.

Since p1p2np_{1} p_{2} \mid n, we have xxp1c(modp1p2)x^{x} \equiv p_{1} c \pmod{p_{1} p_{2}}, hence p1xp_{1} \mid x. But then xxp1cx^{x} \equiv p_{1} c is a p1p_{1}th power modulo p2p_{2} as p1xp_{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: 35=153 \cdot 5 = 15, 311=333 \cdot 11 = 33, 57=355 \cdot 7 = 35) that are good, which means that 4116=2541 - 16 = 25 numbers are bad.

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.