Number Theory 5 Solutions UHSMC
Number Theory 5 Solutions UHSMC
1 Answers
1. 4, 060, 225
2. 4
3. 10
4. 2, 730
5. (24, 70)
6. 1111011111000
7. 408
8. 48
9. 23
10. 1, 012, 032
11. 315
12. 25
13. π
14. 20
15. 42
2 Solutions
1. An integer-valued function f satisfies f (2) = 4 and f (mn) = f (m)f (n) for all integers m and
n. If f is an increasing function, determine f (2015).
Solution: Notice that f (2) = f (1)f (2). It follows by f (2) 6= 0 that f (1) = 1. From here we
can notice that if f (n) = n · |n|, then all of the conditions are satisfied. It follows that f (2015) =
20152 = 4, 060, 225 .
2. The number 229 has a 9-digit decimal representation that contains all but one of the 10 (decimal)
digits. Determine which digit is missing.
Solution: Remembering that the sum of the digits of a number leaves the same remainder as the
number itself when divided by 9, we try taking the remainder when 229 is divided by 9. By Euler’s
Theorem, this is equivalent to 229 ≡ 25 ≡ 5 (mod 9). Now notice that if all of the 10 digits were
included, they would sum to 36 which is equivalent to 0 (mod 9). It follows that the missing digit
1
UHS Math Club 2017-2018
Because n − 1, n, and n + 1 are all factors of this expression, we know 31 divides N as one of these
three factors has to be divisible by 31 . By Fermat’s Little Theorem, one of n or n12 − 1 has to be
divisible by 5, one of n or n12 − 1 has to be divisible by 7, and one of n or n12 − 1 has to be divisible
by 13. It follows that our answer is 21 · 31 · 51 · 71 · 131 = 2, 730 .
5. There exists a unique pair of positive integers k, n such that k is divisible by 6, and ki=1 i2 = n2 .
P
Find (k, n).
Solution: The left hand side of this equation is equivalent to k(k+1)(2k+1) 6 . If we let k = 6y, then
this is equivalent to y(6y + 1)(12y + 1). We can notice that when y = 4, this is equivalent to
4 · 25 · 49 = (2 · 5 · 7)2 = 702 . Therefore, our pair is (k, n) = (6 · 4, 70) = (24, 70) .
6. Determine the smallest positive integer containing only 0 and 1 as digits that is divisible by
each integer 1 through 9.
Solution: In order for the number to be divisible by 8, we must have that the last three digits are
0. This will also guarantee that the number is divisible by 1, 2, 4, and 5. In order for the number
to be divisible by 9, we must have that the sum of its digits is at least 9. Therefore, if the number
has 9 1’s and some number of 0’s, then we can also guarantee that it is divisible by 3, 6, and 9.
The hardest part is finding what numbers will be divisible by 7. Through trial and error with the
fact that 101 ≡ 3 (mod 7), 102 ≡ 2 (mod 7), 103 ≡ 6 (mod 7), 104 ≡ 4 (mod 7), 105 ≡ 5 (mod 7),
and 106 ≡ 1 (mod 7), we can find that the smallest number which satisfies all of these conditions
is 1111011111000 .
7. There exist right triangles with integer side lengths such that the legs differ by 1. For example,
3 − 4 − 5 and 20 − 21 − 29 are two such right triangles. What is the perimeter of the next smallest
Pythagorean right triangle with legs differing by 1?
Solution: Let the smaller leg of such a right triangle be n, and let its hypotenuse be y. It follows
that 2n2 + p 2n + 1 − y 2 = 0. Using the quadratic formula on this expression in terms of n, we get
−2 ± 8y 2 − 4
n = . It follows that 8y 2 − 4 = x2 , for some value of x. Because the left hand
4
side is divisible by 4, it follows that x is even and that 2y 2 − 1 = z 2 for some integer z such that
n = z−1 2 2
2 . Rearranging this equation, we get the common Pell Equation z − 2y = −1. Through
trial and error, we can find that the first few pairs of integers (z, y) which satisfy this equation are
(z, y) = (1, 1), (7, 5), and (41, 29). Using the common fact that solutions to Pell equations can be
recursively used to generate other solutions, we can find that if (z, y) is a solution, (3z + 4y, 2z + 3y)
2
UHS Math Club 2017-2018
is also a solution. It follows that the next solution is (z, y) = (239, 169). Working backwards, this
produces the right triangle with side lengths 119, 120, and 169. The perimeter of this right triangle
is 119 + 120 + 169 = 408 .
8. When 2016 is divided by 1620 and expressed in decimal form, what is the number of digits to
the right of the decimal point? Trailing zeroes should not be included.
Solution: 2016 = 232 · 516 while 1620 = 280 . It follows that the given quotient will give the fraction
516
248
= ( 58 )16 = (0.625)16 . Each time 0.625 is multiplied by itself, it will add exactly 3 digits after
the decimal point, so in total, the quotient will have 3 · 16 = 48 digits to the right of the decimal
point.
9. Let 2016 = a1 × a2 × · · · × an for some positive integers a1 , a2 , ..., an . Compute the smallest
possible value of a1 + a2 +· · · + an .
Solution: Notice that 2016 = 25 · 32 · 71 . Because x + y − xy = 1 − (x − 1)(y − 1), to minimize the
value of a1 +· · · + an , we want to make each of the values from a1 to an as small as possible while
they are still greater than 1. It follows that the sum will be minimized when the values from a1 to
an are the prime factors of 2016. It follows that our answer is 2 + 2 + 2 + 2 + 2 + 3 + 3 + 7 = 23 .
10. Find the number of zeroes at the end of (2016!)2016 . Your answer should be an integer, not its
prime factorization.
Solution: By Legendre’s Formula, the number of zeroes at the end of 2016! is b 2016 2016
5 c + b 25 c +
b 2016 2016
125 c + b 625 c = 403 + 80 + 16 + 3 = 502. It follows that our answer is 2016 · 502 = 1, 012, 032
11. What is the sum of all positive integers less than 30 divisible by 2, 3, or 5?
Solution: It is much simpler to simply subtract the sum of the integers that are not divisible by
2, 3, or 5 from the sum of the first 29 positive integers. This gives us 29·30
2 − 1 − 7 − 11 − 13 − 17 −
19 − 23 − 29 = 315 .
12. Let g0 = 1, g1 = 2, g2 = 3, and gn = gn−1 + 2gn−2 + 3gn−3 . For how many 0 ≤ i ≤ 100 is it
that gi is divisible by 5?
Solution: Notice that the first few values of g leave remainders of 1, 2, 3, 0, 2, 1, 0, 3, 1, 2, 3,· · ·. It
follows that g repeats in cycles of length 8, and each of these cycles has 2 0’s or multiples of 5 in
them. It follows that in the first 96 terms, there are 12 · 2 = 24 multiples of 5. For 96 ≤ i ≤ 100,
there will be 1 multiple of 5 for a total of 25 multiples of 5.
r1 + r2 + ... + rn
13. Define rn to be the number of integer solutions to x2 +y 2 = n. Determine limn→∞ .
n
Solution: Notice that r1 +r2 +· · ·+rn is approximately the number of lattice points within a circle
√ √
of radius n of the origin. This circle can be inscribed in a square of side length 2 n centered
about the origin, and this square has approximately 4n lattice points inside it. The ratio of the
area of the circle to the area of the square is π4 , so the number of lattice points inside the circle
is approximately π4 · 4n = nπ. As n approaches ∞, these approximations will become exact with
negligible errors, and therefore our fraction will approach nπn = π .
14. How many integers less than 400 have exactly 3 factors that are perfect squares?
Solution: A number will have exactly 3 factors that are perfect squares if and only if its prime
factors which divide the number more than once are in powers of the form p4 or p5 . Therefore, we
will do casework on what the value of p is.
Case 1: p = 2
3
UHS Math Club 2017-2018
In this case, we know our number n is divisible by 16 but not 64 and it is not divisible by the
square of any other prime. There are 24 natural numbers less than 400 which are divisible by 16. 6
of these are divisible by 64, and 1 of these is divisible by 9. It follows that there are 24 − 6 − 1 = 17
numbers in this case.
Case 2: p = 3
In this case, we know our number n is divisible by 81 but not by the square of any other prime.
There are 4 multiples of 81 less than 400, but one of these is divisible by 4, so we have 4 − 1 = 3
numbers in this case.
When p > 3, p4 > 400, so these are our only two cases. Adding up our cases, we get an answer of
17 + 3 = 20 .
15. For how many numbers n does 2017 divided by n have a remainder of either 1 or 2?
Solution: If 2017 ≡ 1 (mod n), then it follows that n is a factor of 2016 which is greater than
1. If 2017 ≡ 2 (mod n), then it follows that n is a factor of 2015 which is greater than 2. 2015 =
51 · 131 · 311 , so it follows that 2015 has 7 factors which are greater than 2. 2016 = 25 · 32 · 71 , so it
follows that 2016 has 35 factors which are greater than 2. Therefore our answer is 7 + 35 = 42 .
3 Sources