More Problems
1. Find all primes that can be written both as a sum and a difference of two other primes.
2. How many five-digit numbers consist only of even digits, at least one of which is 2?
3. Find the sum of digits of (102000 − 9) · 102 .
4. Find all integers abcd such that the following relation is satisfied:
abcd + bcd + cd + d = 3102
5. Find all pairs (a, b) of digits such that
ab b
=2−
ba a
6. What is the remainder when 1! + 2! + 3! + . . . + 19! is divided by 100?
7. Find non-zero digits a, b, c, d such that the sum of the four-digit numbers abcd, bcda, cdab, and
dabc has the maximum possible number of divisors.
1
1. Find all primes that can be written both as a sum and a difference of two other primes.
Solution: Let p = q + r and p = s − t. We may assume that q > r. We must have r = 2 and
t = 2, otherwise p would be an even number greater than 2, and so not a prime. Then p = q + 2
and p = s − 2. Hence we see that q = p − 2, p, and s = p + 2 are three consecutive odd numbers.
Hence one of them is a multiple of 3. But since these are all primes, this multiple must be 3
itself. The cases p = 3 and s = 3 fail since 1 is not a prime. Thus the only solution is p = 5 for
which q = 3 and s = 7 are primes
2
2. How many five-digit numbers consist only of even digits, at least one of which is 2?
Solution: There are 4 · 54 five-digit numbers made up of only even digits (4 choices for the first
digit and 5 choices for each of the remaining digits). Also, there are 3 · 44 five-digit numbers
made up of digits 0, 4, 6, 8. Therefore, the answer is 4 · 54 − 3 · 44 = 1732.
3
3. Find the sum of digits of (102000 − 9) · 102 .
Solution: We can write
(102000 − 9) · 102 = |99 {z
. . . 9}100
1999 times
hence the sum of digits of this integer is 9 · 1999 + 1 = 17992.
4
4. Find all integers abcd such that the following relation is satisfied:
abcd + bcd + cd + d = 3102
Solution: We have
abcd + bcd + cd + d = a103 + b102 + c10 + d + b102 + c10 + d + c10 + d + d
= 1000 · a + 200 · b + 30 · c + 4d,
and the following relation holds.
1000 · a + 200 · b + 30 · c + 4d = 3102
There are two possibilities for d, that is d = 3 or d = 8, hence we have to consider two cases.
5
5. Find all pairs (a, b) of digits such that
ab b
=2−
ba a
Solution: We can rewrite this as
ab b
−1=1−
ba a
or
10a + b b
−1=1−
10b + a a
We can transform both sides as
10a + b − (10b + a) a−b 9(a − b) a−b
= i.e., =
10b + a a 10b + a a
This yields a = b or 9a = 10b + a, i.e., 4a = 5b, so the answer are the pairs
(1, 1), (2, 2), . . . , (9, 9), and (5, 4)
6
6. What is the remainder when 1! + 2! + 3! + . . . + 19! is divided by 100?
Solution: Any of the numbers 10!, 11!, . . . , 19! are divisible by 100. Hence we can reduce the
problem to finding the remainder of 1! + 2! + . . . + 9! divided by 100. Notice that 8! + 9! = 8! · 10
which is also divisible by 100. Finally,
1! + 2! + . . . + 7! = 1 + 2 + 6 + 24 + 120 + 720 + 5040 = 5913
Hence the remainder is 13.
7
7. Find non-zero digits a, b, c, d such that the sum of the four-digit numbers abcd, bcda, cdab, and
dabc has the maximum possible number of divisors.
Solution: How many divisors does a number have? The answer can be found if we first represent
the number using prime factorization. For example, 6615 = 33 · 5 · 72 and any divisor will have
a prime factorization of the form 3a · 5b · 7c , where a can take 4 different values (0,1,2,3), b
can take 2 different values (0,1), and c can take 3 different values (0,1,2). Therefore, 6615 has
(3 + 1)(1 + 1)(2 + 1) different divisors. We see that the number of divisors of a number depends
only on the multiplicity of its prime factors. Adding up the numbers 1000a + 100b + 10c + d,
1000b + 100c + 10d + a, 1000c + 100d + 10a + b, and 1000d + 100a + 10b + c we obtain
1111(a + b + c + d) = 11 · 101(a + b + c + d).
The sum a + b + c + d can be any number n in the range from 4 to 36 (inclusive), thus we need
to know the maximum number of divisors of
11 · 101 · n for such an n. Note that 11 · 101 · n has at most 4 times the number of divisors of
n (and it has exactly 4 times as many unless either 11 or 101 divides n). Thus, let us see what
is the maximum possible number of divisors of n. One could do this by simply going through
the cases, but we can also argue as follows. The smallest number with 4 or more distinct prime
factors is 2 · 3 · 5 · 7 = 210 so n has at most 3 distinct prime factors. The smallest number with
3 distinct prime factors at least one of which is repeated is 22 · 3 · 5 = 60. Hence if n has 3
distinct prime factors, they are single factors n = p · q · r and n has (1 + 1)(1 + 1)(1 + 1) = 8
divisors. If n = pi q j has only two distinct prime factors and more than 8 divisors, then we have
(i + 1)(j + 1) > 8, so either j = 1 and i ≥ 4 (or the reverse) or i, j ≥ 2. In the first case n
would be at least 24 · 3 = 48 and in the latter case n would be at least 22 · 32 = 36. Hence n
has at most 9 divisors and this occurs only for n = 36. Thus 11 · 101 · n has at most 36 divisors
and this occurs only if a = b = c = d = 9 for which the sum is 22 · 32 · 11 · 101 which has
(2 + 1)(2 + 1)(1 + 1)(1 + 1) = 36 divisors.