Maths Olympiad Prep

Library / /187 of 348

Number theory Difficulty 4.9 AIME Find the answer

A number nn is badb a d if there exists some integer cc for which xxc(modn)x^{x} \equiv c(\bmod n) has no integer solutions for xx. Find the number of bad integers between 2 and 42 inclusive.

A number or a short expression. Spacing and $ signs are ignored.

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 1 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\left(\bmod p_{1} p_{2} \ldots p_{k}\right) and x1(mod(p11)(p21)(pk1))x \equiv 1\left(\bmod \left(p_{1}-1\right)\left(p_{2}-1\right) \ldots\left(p_{k}-1\right)\right). Since, by assumption, p1p2pkp_{1} p_{2} \ldots p_{k} and (p11)(p21)(pk1)\left(p_{1}-1\right)\left(p_{2}-1\right) \ldots\left(p_{k}-1\right) are relatively prime, such an xx must exist by CRT. Then xxc1=cx^{x} \equiv c^{1}=c (modn)(\bmod 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 \operatorname{gcd}\left(p_{1}, p_{2}-1\right) \neq 1(whichmustholdforsometwoprimesbyassumption),andhencegcd(p1,p21)=p1 (which must hold for some two primes by assumption), and hence \operatorname{gcd}\left(p_{1}, p_{2}-1\right)=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(\bmod n) is not solvable. Since p1p2np_{1} p_{2} \mid n, we have xxp1c(modp1p2)x^{x} \equiv p_{1} c\left(\bmod p_{1} p_{2}\right), 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 16 numbers ( 13 primes: 2,3,5,7,11,13,17,19,23,29,31,372,3,5,7,11,13,17,19,23,29,31,37, 41 ; and 3 semiprimes: 35=15,311=33,57=35)3 \cdot 5=15,3 \cdot 11=33,5 \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: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.