Maths Olympiad Prep

Library / /1030 of 1394

, 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 2n502 \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<k1<n0 < k^{-1} < n such that kk11(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 k21(modn)k^{2} \equiv 1 \pmod{n}, then (nk)21(modn)(n-k)^{2} \equiv 1 \pmod{n} as well, and k(nk)k21(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 n2n \neq 2, there is no kk such that k21(modn)k^{2} \equiv 1 \pmod{n} and knk(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 k21(modn)k^{2} \equiv 1 \pmod{n}.

For prime pp and positive integer ii, the number of solutions to k21(modpi)k^{2} \equiv 1 \pmod{p^{i}} is 22 if pp is odd, 44 if p=2p=2 and i3i \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,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.