Maths Olympiad Prep

Library / /70 of 86

Number theory Difficulty 7.5 National Olympiad, round 2 Prove it United States

Problem:
Every positive integer is either nice or naughty, and the Oracle of Numbers knows which are which. However, the Oracle will not directly tell you whether a number is nice or naughty. The only questions the Oracle will answer are questions of the form "What is the sum of all nice divisors of nn?", where nn is a number of the questioner's choice. For instance, suppose (just for this example) that 22 and 33 are nice, while 11 and 66 are naughty. In that case, if you asked the Oracle, "What is the sum of all nice divisors of 66?", the Oracle's answer would be 55.
Show that for any given positive integer nn less than 11 million, you can determine whether nn is nice or naughty by asking the Oracle at most four questions.

Solution

Solution:
Let f(u)f(u) denote the sum of all nice divisors of uu. Note that f(u)σ(u)f(u) \leq \sigma(u), where σ(u)\sigma(u) denotes the sum of all the divisors of uu, including 11 and uu.

We also note the following facts about the σ\sigma function:

1. σ\sigma is multiplicative: if aa and bb are relatively prime (share no prime factors), then σ(ab)=σ(a)σ(b)\sigma(ab) = \sigma(a) \sigma(b).
2. If pp is prime, then σ(pa)=1+p+p2++pa=pa+11p1=pa(p1/pap1)<pa(pp1)\sigma(p^{a}) = 1 + p + p^{2} + \cdots + p^{a} = \frac{p^{a+1} - 1}{p - 1} = p^{a} \left(\frac{p - 1 / p^{a}}{p - 1}\right) < p^{a} \left(\frac{p}{p - 1}\right).

To solve the problem, let us consider a few cases.

- Suppose nn is prime. Then ask the Oracle to compute f(n)f(n). Clearly f(n)nf(n) \geq n if and only if nn is nice.

- Suppose nn is a power of a prime, so n=pan = p^{a} for some prime pp, with a>1a > 1. Again, ask the Oracle to compute f(n)f(n). We claim again that f(n)nf(n) \geq n if and only if nn is nice. Clearly if nn is nice, then f(n)>nf(n) > n. But if nn is naughty, then f(n)=f(pa1)σ(pa1)<pa1(pp1)2pa1paf(n) = f(p^{a-1}) \leq \sigma(p^{a-1}) < p^{a-1} \left(\frac{p}{p-1}\right) \leq 2 p^{a-1} \leq p^{a}.

- Now suppose that nn has at least two prime factors, so we can write n=paqbRn = p^{a} q^{b} R, where p,qp, q are the two smallest primes found in the factorization of nn, a,b>0a, b > 0, and RR is an integer whose prime factorization does not contain pp or qq (of course, RR could equal 11). Note that RR contains at most 55 different primes, since the product of the first 88 primes is larger than 11 million. We will modify the previous strategy, where we examined a subset of the divisors of nn that were less than nn and whose sum was bounded below nn; this allowed us to focus on nn and determine whether it is nice or naughty.

The subset of the divisors that we seek is the set DD of divisors of nn that are multiples of paqbp^{a} q^{b}; in other words, D:={paqbr:r divides R}D := \{ p^{a} q^{b} r : r \text{ divides } R \}. We claim that the sum of the elements of DD is less than 2n2n, and since paqbR=nDp^{a} q^{b} R = n \in D, we conclude that nn is nice if and only if the sum of the nice members of DD is greater than or equal to nn (this follows because our claim implies that the members of DD that are not nn have a sum that is strictly less than nn).

Two things remain: to verify the claim that the sum of all the members of DD is less than 2n2n, and we need to know how to get the Oracle to compute the sum of the nice members of DD with at most four questions.

1. The sum of the members of DD is equal to paqbσ(R)p^{a} q^{b} \sigma(R). By fact #2 above,
σ(R)<R(p1p11)(p2p21) \sigma(R) < R \left(\frac{p_{1}}{p_{1} - 1}\right) \left(\frac{p_{2}}{p_{2} - 1}\right) \cdots
where the pip_{i} range over the distinct prime factors of RR. We know that there are at most five such prime factors, and this product is bounded above by
(54)(76)(1110)(1312)(1716)=71113172109=10011710249, \left(\frac{5}{4}\right) \left(\frac{7}{6}\right) \left(\frac{11}{10}\right) \left(\frac{13}{12}\right) \left(\frac{17}{16}\right) = \frac{7 \cdot 11 \cdot 13 \cdot 17}{2^{10 \cdot 9}} = \frac{1001 \cdot 17}{1024 \cdot 9},
which is clearly less than 22.

2. Finally, let the "universal set" be the divisors of nn, and let PP and QQ denote the divisors of n/pn/p and n/qn/q, respectively. It is easy to see that PQP \cup Q is the complement of DD (since membership in PP guarantees that the exponent of pp is too small, and membership in QQ does the same for qq). By the inclusion-exclusion principle, the members of DD can be obtained by starting with the universal set (all divisors of nn), removing members of PP, removing members of QQ, and then adding back in the members of PQP \cap Q, which just consists of the divisors of n/(pq)n/(pq). Consequently, the sum of the nice members of DD is given by
f(n)f(n/p)f(n/q)+f(n/(pq)) f(n) - f(n/p) - f(n/q) + f(n/(pq))
which requires just four questions to compute!

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.