Maths Olympiad Prep

Library / HMMT February /962 of 1302

HMMT February, 2016

Number theory Difficulty 5.5 AIME, harder Prove it United States

Problem:

Define ϕ!(n)\phi^{!}(n) as the product of all positive integers less than or equal to nn and relatively prime to nn. Compute the number of integers 2≤n≤502 \leq n \leq 50 such that nn divides ϕ!(n)+1\phi^{!}(n)+1.

Solution

Solution:

Note that, if kk is relatively prime to nn, there exists a unique 0<k−1<n0 < k^{-1} < n such that kk−1≡1(modn)k k^{-1} \equiv 1 \pmod{n}. Hence, if k2≢1(modn)k^{2} \not\equiv 1 \pmod{n}, we can pair kk with its inverse to get a product of 11.

If k2≡1(modn)k^{2} \equiv 1 \pmod{n}, then (n−k)2≡1(modn)(n-k)^{2} \equiv 1 \pmod{n} as well, and k(n−k)≡−k2≡−1(modn)k(n-k) \equiv -k^{2} \equiv -1 \pmod{n}. Hence these kk can be paired up as well, giving products of −1-1. When n≠2n \neq 2, there is no kk such that k2≡1(modn)k^{2} \equiv 1 \pmod{n} and k≡n−k(modn)k \equiv n-k \pmod{n}, so the total product (modn)\pmod{n} is (−1)m2(-1)^{\frac{m}{2}}, where mm is the number of kk such that k2≡1(modn)k^{2} \equiv 1 \pmod{n}.

For prime pp and positive integer ii, the number of solutions to k2≡1(modpi)k^{2} \equiv 1 \pmod{p^{i}} is 22 if pp is odd, 44 if p=2p=2 and i≥3i \geq 3, and 22 if p=i=2p=i=2. So, by Chinese remainder theorem, if we want the product to be −1-1, we need n=pkn = p^{k}, 2pk2p^{k}, or 44. We can also manually check the n=2n=2 case to work.

Counting the number of integers in the allowed range that are of one of these forms (or, easier, doing complementary counting), we get an answer of 3030.

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.