You are on page 1of 5

Number Theory A Solutions

1. Find the number of positive integers n < 2018 such that 25n + 9n is divisible by 13.
Proposed by: Eric Neyman
Answer: 336
Modulo 13, 25n alternates −1, 1, −1, 1, . . . and 9n alternates 9, 3, 1, 9, 3, 1, . . . . Thus, their sum
alternates 8, 4, 0, 10, 2, 2, 8, 4, 0, 10, 2, 2, . . . . Thus, the relevant values of n are the ones that
are 3 (mod 6). These go 3, 9, 15, . . . , 2013, so there are 2016 6 = 336 of them.

2. For a positive integer n, let f (n) be the number of (not necessarily distinct) primes in the
prime factorization of n. For example, f (1) = 0, f (2) = 1, and f (4) = f (6) = 2. Let
g(n) be the number of positive integers k ≤ n such that f (k) ≥ f (j) for all j ≤ n. Find
g(1) + g(2) + . . . + g(100).
Proposed by: Michael Gintz
Answer: 136
Observe that g(1) = 1, g(2) = 1, g(3) = 2, g(4) = 1, g(5) = 1, g(6) = 2, g(7) = 2, . . . , where the
pattern is that g(2k ) through g(1.5 · 2k − 1) are equal to 1, and g(1.5 · 2k ) through g(2k+1 − 1)
are equal to 2. This is because 2k is the first positive integer n for which f (n) = k, and
1.5 · 2k = 3 · 2k−1 is the second, with no third one before 2k+1 . Thus, for g = 2 through 63, half
the values are 1 and half are 2, giving a sum of 93 in this range. We have g(1) = 1, g(n) = 1
for 64 ≤ n < 96, and g(n) = 2 for 96 ≤ n ≤ 100, for a total of 93 + 1 + 32 + 2 · 5 = 136 .
3. What is the largest integer n < 2018 such that for all integers b > 1, n has at least as many
1’s in its base-4 representation as it has in its base-b representation?
Proposed by: Eric Neyman
Answer: 1365
Observe that only 1’s and 0’s are possible in the 4-ary representation of n: if n has the digit
in its 4-ary representation, then there are two corresponding bits in its binary representation.
These are 00 for 0, 01 for 1, 10 for 2, and 11 for 3. The largest possible contender is thus
1111114 = 1365 . Clearly 1365 also has 6 ones in its binary representation, and it is easy to
check that it has fewer than 6 ones in its 3-ary representation. No larger bases need to be
checked since 1365 has at most 6 digits in its base-b representation for any b > 4.
4. Let n be a positive integer. Let f (n) be the probability that, if divisors a, b, c of n are selected
uniformly at random with replacement, then gcd(a, lcm(b, c)) = lcm(a, gcd(b, c)). Let s(n) be
1
the sum of the distinct prime divisors of n. If f (n) < 2018 , compute the smallest possible value
of s(n).
Proposed by: Eric Neyman
Answer: 58
Let vp (k) be the number of times p appears in the factorization of k. The equality holds if and
only if for each prime factor p of n, min(vp (a), max(vp (b), vp (c))) = max(vp (a), min(vp (b), vp (c))).
In general, given three numbers x, y, and z¡ we have min(x, max(y, z)) ≤ x ≤ max(x, min(y, z)),
with both equalities holding if and only if min(y, z) ≤ x ≤ max(y, z) — that is, if x is in be-
tween y and z.
Note that vp (a), vp (b), and vp (c) are uniformly selected between 0 and vp (n), which means that
the probability that vp (a) is between vp (b) and vp (c) is at least 13 . Thus, since 36 < 2018 < 37 ,
n must have at least 7 distinct prime factors. And 7 is enough, since as vp (n) gets large, the
probability that vp (a) is between vp (b) and vp (c) gets close to 31 . Thus, the smallest possible
value of s(n) is 2 + 3 + 5 + 7 + 11 + 13 + 17 = 58 .

1
5. Find the remainder when
1903
Y
(2i + 5)
i=1

is divided by 1000.
Proposed by: Nathan Bergman
Answer: 931
We first consider the product mod 8. We observe that for i ≥ 3, each term is congruent to 5
(mod 8). so We have 7 ∗ 1 ∗ 51901 , which simplifies to 3 (mod 8). We now consider the product
mod 125. We first consider powers of 2 (mod 25). By multiplying out powers of 2, we see
that 2 is a generator mod 25 because its order is 20. We now claim that 2 is a generator mod
125. Then we want to show that its order is φ(125) = 100. Its order must divide 100 and be a
multiple of 20, so we must check 20 and 50. We know that 220 = (27 )3 ∗ 2−1 ≡ (32 ∗ 64) ≡ 76
(mod 125). We note that 250 ≡ (27 )7 ∗ 2 ≡ 37 ∗ 2 ≡ −1 (mod 125), so 2 is a generator mod
125. Then every 100 terms in the product given are just a rearrangement of the product of
the 100 powers of two (mod 125). So
1903
Y
(2i + 5) ≡
i=1

100
Y
≡( (2i ))19 ∗ 7 ∗ 9 ∗ 13 ≡
i=1
19
≡ (−1) ∗ 7 ∗ 9 ∗ 13 ≡ (−1) ∗ 7 ∗ 9 ∗ 13 ≡ 56
(mod 125). Then bringing the two results together, the result is equivalent to 3 mod 8 and 56
mod 125, for a final answer of 931 (mod 1000). So the remainder is 931 .

6. Find the remainder of


99
Y
(1 − n2 + n4 )(1 − 2n2 + n4 )
n=2

when divided by 101.


Proposed by: Jackson Blitz
Answer: 70
Let p = 101. We evaluate each product separately.
First,
Y99 99
Y 99
Y
(1 − 2n2 + n4 ) = (1 − n2 )2 = (1 − n)2 (1 + n)2
n=2 n=2 n=2

1 1
= (100!)2 · (98!)2 · ≡ ≡ 16−1 mod p
4 4 · (−2)2
from Wilson theorem.
The other product is
99 99 100
Y Y 1 + n6 Y 1 + n6
(1 − n2 + n4 ) ≡ 9 ≡9
n=2
1 + n2 1 + n2
n=2,n2 6=−1 n=1,n2 6=−1

2
as n2 = −1 has 2 solutions. Since 3 - 100, n6 = −1 has the same solutions as n2 = −1. We
thus have
100
Y 1 + n6
=1
2
1 + n2
n=1,n 6=−1

as the sixth power residues modulo 101 are the same as the quadratic residues (as, again,
9
3 - 100). Hence the final answer is 16 ≡ 70 (mod 101).
7. Find the smallest positive integer G such that there exist distinct positive integers a, b, c with
the following properties:

• gcd(a, b, c) = G.
• lcm(a, b) = lcm(a, c) = lcm(b, c).
1
• a + 1b , 1
a + 1c , and 1
b + 1
c are reciprocals of integers.
• gcd(a, b) + gcd(a, c) + gcd(b, c) = 16G.
Proposed by: Eric Neyman
Answer: 15
Let Gga = gcd(b, c), Ggb = gcd(a, c) and Ggc = gcd(a, b), so ga + gb + gc = 16, and ga , gb ,
and gc are relatively prime. We can write a as G times the factors in common between a and
b only (gc ) times the factors in common between a and c only (gb ) times the factors in a only.
The last term is 1 because a | bc. Thus, a = Ggb gc . Similarly, b = Gga gc and c = Gga gb .
1 1 ga +gb
We have a + b = Gga gb gc , so ga + gb | Gga gb gc . Since ga and gb are relatively prime, ga + gb
shares no factors with ga or gb , so in fact ga + gb | Ggc . We can rewrite this as lcm(gag+g c
b ,gc )
| G.
Since lcm(ga +gb , gc )·gcd(ga +gb , gc ) = gc (ga +gb ), we can write gcd(ggaa+g b
+gb ,gc ) | G. Equivalently

16 − gc 16 − gc lcm(16 − gc , 16)
= = | G.
gcd(16 − gc , gc ) gcd(16 − gc , 16) 16

We have analogous equations for ga and gb . Letting x = 16 − ga , y = 16 − gb , and z = 16 − gc ,


we have that lcm(x,16)
16 | G and similarly for y and z. Now, observe that x, y, and z have the
same parities as ga , gb , and gc , respectively. Since ga , gb , and gc are relatively prime, at most
one of x, y, and z is even. One of them most be even because their sum, 32, is even. Without
loss of generality, say that x is even and y and z are odd. Then lcm(y,16) 16 = y and similarly
lcm(x,16)
for z. Thus, G is divisible by 16 , y, and z. There are two intuitions for what x, y, and
z to search for: (i) x should have lots of 2’s in its factorization; and x, y, and z should have
factors in common. With these intuitions in mind, a natural combination to try is (12, 5, 15),
with the minimal possible G being lcm(3, 5, 15) = 15. This is optimal because one of y and
z must be greater than 8 (say y), which means that to beat 15 we must have lcm(y, z) = y.
Since y 6= z, we cannot have y be prime (since y + z > 16 so z > 1), so the only possibility is
y = 9 and z = 3, but again we have y + z < 16, which is not allowed. Thus, the answer is 15 .
8. Let p be a prime. Let f (x) be the number of ordered pairs (a, b) of positive integers less than
p, such that ab ≡ x (mod p). Suppose that there do not exist positive integers x and y, both
less than p, such that f (x) = 2f (y), and that the maximum value of f is greater than 2018.
Find the smallest possible value of p.
Proposed by: Eric Neyman
Answer: 331

3
Let r be a primitive root mod p. Then a can be written uniquely as rc for 0 ≤ c < p − 1,
so ab = rbc . Since rt has period p − 1 and cycles through all values mod p besides 0, the
distribution of the values of f (x) is the same as the distribution of values in the p − 1 by
p − 1 multiplication table mod p − 1. Thus, we are looking for the smallest p such that, in the
multiplication table mod n := p − 1, no value is twice as common as any other, and the most
common value appears more than 2018 times.
Observe that for any x, x appears as many times in the multiplication table as gcd(n, x).
x
Indeed, since gcd(n,x) is relatively prime to n (and thus invertible mod n), if bc ≡ x (mod n)
   
then b c · gcd(n,x)
x ≡ gcd(n, x) (mod n), and if bc ≡ gcd(n, x) (mod n) then b c · x
gcd(n,x) ≡
x (mod n); this is a bijection. Thus, we can restrict out attention to divisors d of n. Similarly,
note that the distribution of values of bc when b = b0 (for any b0 ) is the same as the distribution
of values of bc when b = gcd(n, b0 ). Thus, we may assume that b | n and multiply our count
by ϕ nb (since that is how many integers b0 mod n satisfy gcd(b0 , n) = b).
Fix b | n; how many c’s are there such that bc = d (where d | n)? If b - d then 0. Otherwise, it
is b, since each of the nb multiples of b appear an equal number of times in b’s row. Therefore,
if g(d) denotes the number of times that d appears in the multiplication table, we have
X n
g(d) = bϕ .
b
b|d

2
 n is square-free. Indeed, suppose that q | n. Then g(1) = ϕ(n) and
Now, we claim that
g(q) = ϕ(n) + qϕ nq = ϕ(n) + q · ϕ(n)q = 2ϕ(n) = 2g(1), contradicting the fact that no entry
appears twice as often as any other.
Now, write n = q1 q2 . . . qm . Let b = q1 q2 . . . qk . We have
n
bϕ = q1 . . . qk (qk+1 − 1) . . . (qm − 1).
b
Thus, if d = q1 q2 . . . qj , we may write

g(d) = (q1 + (q1 − 1))(q2 + (q2 − 1)) . . . (qj + (qj − 1))(qj+1 − 1) . . . (qm − 1).

(Think of the first j terms as choosing whether or not qi divides each b.) Thus, g(d) is a
product over the primes dividing n of 2q − 1 for the primes q dividing d and q − 1 for the
primes q not dividing d. In particular, when d = n, g attains its maximum, and is equal to
(2q1 − 1) . . . (2qm − 1). We wish for this quantity to be greater than 2018. We find that if
n = 2 · 3 · 5 · 11 = 330 then this quantity is 3 · 5 · 9 · 21 = 2835. Note that p = 331 is prime.
To verify that p = 331 satisfies the other condition, note that for a given x, g(x) is a product
of one number taken from each of the following four sets: {1, 3}, {2, 5}, {4, 9}, and {10, 21}.
Suppose g(x) = 2g(y) for some x, y. Then either both or neither take the 21, since that is the
only multiple of 7 available. Thus, the products from the three remaining sets have to have
the property that one is twice the other. By the same reasoning, then, the same number is
taken from the second set. From here it is clear that one number cannot be twice the other.
To verify that no n < 330 exists, we observe that q 2q−1 would have to exceed 2018
Q
q 330 > 6. This
shows that at least three primes must be in the factorization of n. For four or more primes
it is clear that 330 is optimal (2 · 3 · 5 · 7 doesn’t work). Now suppose n has three primes in
its factorization. Observe that 2 | n since p = n + 1 is prime. The product of 2q−1 q for the
remaining two primes must be at least 2018 330 · 2
3 > 4, a contradiction.
We conclude that the answer is 331 .

4
If you believe that any of these answers is incorrect, or that a problem had multiple reasonable
interpretations or was incorrectly stated, you may appeal at http://tinyurl.com/PUMaCappeal2018.
All appeals must be in by 1 PM to be considered.

You might also like