You are on page 1of 3

Number Theory Worksheet 4 – Digits

All SMC, BMO and Mentoring problems are © UKMT (www.ukmt.org.uk)

1. What is the last digit of 703703?


2. In an earlier worksheet we determined that 25 !=222 ×310 ×56 ×7 3 × 112 × 13× 17 ×23.
Find the last non-zero digit of 25 !.
3. Prove that:
a. If we take a 2-digit number, reverse its digits, then the difference between this new
number and the original is divisible by 9.
b. That if the digits of a number add up to 9, then the number is divisible by 9.
4. [Source: BMO] Find, showing your method, a six-digit integer n with the following
properties:
(i) n is a perfect square,
(ii) the number formed by the last three digits of n is exactly one greater than the number
formed by the first three digits of n. (Thus n might look like 123124, although this is not a
square.)

www.drfrostmaths.com/rzc
Number Theory Worksheet 4 – Digits - ANSWERS

1. What is the last digit of 703703?


This is equivalent to the last digit of 3703.
175
3 4 ≡ 1(mod 10), so 3700 ≡ ( 34 ) ≡1 ( mod 10 ). So multiplying by three more 3s, the last digit
is 7.

2. In an earlier worksheet we determined that 25 !=222 ×310 ×56 ×7 3 × 112 × 13× 17 ×23.
Find the last non-zero digit of 25 !.
We can get rid of all the trailing zeros by getting rid of all the 2 ×5 pairs. This leaves:
216 × 310 × 73 ×112 ×13 ×17 ×23 Let’s work mod-10 to get the last digit of this. Increasing
powers of 2 oscillate between 2, 4, 8, 6 in modulo-10, so the last digit of 216 is 6.
3 4 ≡ 1(mod 10) so 38 ≡1(mod 10) so 310 ≡9 ( mod 10 ) . 73 ≡6 ( mod 10 ). Multiplying all the
digits mod-10 we have:
6 ×1 × 9× 1× 3× 7 ×3 ≡6 ( mod 10 )
Recall that when multiplying these numbers we only need to keep the last digit after each
multiplication.

3. Prove that:
a. If we take a 2-digit number, reverse its digits, then the difference between this
new number and the original is divisible by 9.
Let the original number be ab . Then the value of the original and reverse numbers
are 10 a+b and 10 b+ a. The difference is 10 a+b−( 10 b+ a )=9 (a+b). This is
divisible by 9.
b. That if the digits of a number add up to 9, then the number is divisible by 9.
Note that a proof only for numbers with a given number of digits is clearly not
sufficiently general. Let the digits of a k -digit number be a k a k−1 … a 2 a 1. The value of
k k
k−1
the number is V =∑ 10 ⋅ ak . If the digits add to a multiple of 9, then ∑ ai=9 q
i=1 i=1
for some integer q .
k
k−1
Then V =9 q+ ∑ ( 10 −1 ) ⋅ak . To show V is divisible by 9, it’s sufficient to show
i=1

that 10k−1−1 is divisible by 9 for all k .


Now 10 ≡1(mod 9) , so 10k−1 ≡1k−1 ≡ 1 ( mod 9 ). Thus 10k−1−1 ≡ 0 ( mod 9 ).

4. Find, showing your method, a six-digit integer n with the following properties:
(i) n is a perfect square,
(ii) the number formed by the last three digits of n is exactly one greater than the number
formed by the first three digits of n. (Thus n might look like 123124, although this is not a

www.drfrostmaths.com/rzc
square.)
Suppose the first few three digits were given by a number N . Then the value of the whole 6-
digit number is 1000 N + N +1=1001 N +1.
Forming a Diophantine Equation, we have 1001 N + 1=k 2 .
Then 1001 N =k 2−1=( k +1 )( k −1 ). It’s worth at this point putting a bound on k .
k ≤ 999 otherwise we’d have a 7-digit number. And k ≥ 317 otherwise we’d have a 5-digit
number. We also know N <1000 because we defined N to be a 3-digit number.
Also note that 1001=7 × 11 ×13. We need to think how to split up these three primes
factors into the k +1 and k −1. They can’t all be in one of the two factors on the RHS,
because we’ve established that k ≤ 999, and 1001>999+1. Thus we must have two of
these primes in one of the factors on the RHS, and one in the other. That’s 6 cases to
consider.

Case 1 is that k +1=77 a and k −1=13 b (where ab=N ). The quickest way to find a
solution here is to consider multiples of 77 (i.e. 77 a ), subtract 2 (so that we go from k +1 to
k −1), and see it’s a multiple of 13. This could involve a lot of calculation, but some modular
arithmetic might speed us up. 77 ≡12 ≡−1(mod 13). So each time we increase our
multiple of 77, the remainder modulo-13 decreases by 1. Now the first multiple of 77 (77
itself) gives a remainder of 12, and subtracting 2 would give a remainder of 10. This means
that were we to add on ten more 77s, we’d clear away the remainder in modulo-13.
Thus a=11 and b=( ( 77 ×11 )−2 ) ÷13=65 . So N=65× 11=715 . Thus 715716 is one
possible six-digit number!

I at this point got bored of working out the other numbers, and with the lack of model UKMT
solutions, used Excel to determine the remaining solutions as 183184, 328329 and 528529.
(For those interested, I used Autocomplete to list the numbers from 100000 to 999999,
using a formula for each to display something in the cell if the square root of the number
was a whole number – thus allowing me to see a flash of black pixels as I rapidly scrolled
down).

www.drfrostmaths.com/rzc

You might also like