maths.
org/step
STEP Support Programme
Assignment 17
Warm-up
1 This question is about modular arithmetic (and so is the warm-down); a very simple idea,
but a very important tool in the theory of numbers.
We say that
N mod a = n
if the remainder when N is divided by a is n. For example
10 mod 3 = 1 and 25 mod 5 = 0 ,
since 10 ÷ 3 = 3 remainder 1, and 25 ÷ 5 = 5 with no remainder.
The possible values of N mod 3 are 1, 2 or 0 (if N is divisible by 3). This means that N can
be written in the form
3m
if N mod 3 = 0
N = 3m + 1 if N mod 3 = 1
3m + 2 if N mod 3 = 2
where m is some integer.
More generally,
N mod a = n ⇐⇒ N = am + n (∗)
for some integer m.
(i) Use (∗) to prove that if N1 mod a = n1 and N2 mod a = n2 then
(N1 + N2 ) mod a = (n1 + n2 ) mod a .
and
N1 N2 mod a = n1 n2 mod a .
These two results are required over and over again when using modular arithmetic.
Start by writing N1 = am1 + n1 and similarly for N2 . A bit of care is needed as it
is not necessarily true that (N1 + N2 ) mod a = (n1 + n2 ) (because n1 + n2 might be
greater than a — in which case, it can be written as a + (n1 + n2 ) mod a).
It is often a good idea to use a numerical example to make sure you fully understand a
new idea. So we could consider 22 mod 5 = 2 and 8 mod 5 = 3. We can then see that
(22 × 8) mod 5 = 176 mod 5 = 1 and (2 × 3) mod 5 = 6 mod 5 = 1.
Note that a numerical example is not a proof, but it is a useful sanity check.
Assignment 17 1
maths.org/step
If x mod a is the same as y mod a then we can say that x and y are congruent mod a. We
write this as:
x ≡ y (mod a)
(note the brackets). For example,
16 ≡ 31 (mod 5) and 14 ≡ −1 (mod 3) .
In the first case it is clear that both 16 and 31 leave the same remainder when they are
divided by 5. In the second case, note that 14 = 3 × 4 + 2 and −1 = 3 × −1+2.
Two numbers are congruent mod a if their difference is equal to 0 mod a i.e.
x≡y (mod a) ⇐⇒ (x − y) mod a = 0 .
Note that 14 − (−1) mod 3 = 0.
So if N1 ≡ n1 mod a and N2 ≡ n2 mod a, then we can write
N1 + N2 ≡ n1 + n2 (mod a) and N1 N2 ≡ n1 n2 (mod a) . (∗∗)
(ii) Noting that 10 mod 3 = 1, show that (10a + b) mod 3 = (a + b) mod 3, where a and b
are integers.
Deduce that a decimal number between 0 and 99 with digits ab is divisible by 3 if and
only if a + b ≡ 0 (mod 3).
You have to use the results of part (i) quite a few times to do the first part; or you
can use the notation of (∗∗).
By considering 10n mod 3, devise a test to determine whether an n-digit decimal num-
ber with digits a1 a2 . . . an is divisible by 3.
(iii) Devise a test to determine whether a 4-digit decimal number with digits abcd is divisible
by 11.
Assignment 17 2
maths.org/step
Preparation
2 (i) Solve the following set of simultaneous equations.
w+x+y+z =1
w−x+y−z =0
4w + 3x + 2y + 3z = 3
4w − 3x + 2y − 9z = −1
(ii) Evaluate the following:
5
P i
(a)
i=3 i − 1
2
r2
P
(b)
r=−2
1 1 1 Pn 1
(iii) Show that = − . Hence find an expression for .
r(r + 1) r r+1 r=1 r(r + 1)
Check your answer by taking n = 3.
200
P 1
Find
r=100 r(r + 1)
(iv) By setting x = 0 and x = 1 in turn, find a and b such that
1 a b
≡ +
x2 + 3x + 2 x+1 x+2
The STEP question
n
r2 can be written in the form pn3 + qn2 + rn + s , where p , q , r and s
P
3 It is given that
r=−1
are numbers. By setting n = −1, 0, 1 and 2, obtain four equations that must be satisfied by
p , q , r and s and hence show that
n
r2 = 16 n(n + 1)(2n + 1) .
P
r=0
n
r3 can be written in the form an4 + bn3 + cn2 + dn + e , show similarly that
P
Given that
r=−2
n
r3 = 41 n2 (n + 1)2 .
P
r=0
Assignment 17 3
maths.org/step
Warm down
4 A certain sort of divisibility question used to come up on scholarship papers, intended perhaps
as an exercise in the use of proof by mathematical induction; though often they could be
more easily and more enjoyably done using modular arithmetic. Question (iii) below is a
good example, which occurred on a STEP paper in 1987 (there has not been an example
since). Parts (i) and (ii) are supposed to give you some ideas for tackling part (iii). Of
course, the basic idea for showing that a number N is divisible by a (say) is to show that
N mod a = 0, but you sometimes have to be quite ingenious.
(i) Show that 3 × 22n + 2 × 32n is divisible by 5.
You could either use 3 ≡ −2 ( mod 5) or 22n ≡ 4n ≡ (−1)n ( mod 5) with a similar
result for 32n .
(ii) Show that, if n is odd, then 2n + 5n + 56 is divisible by 3. Show also that it is divisible
by 21.
Show further it is divisible by 63 if n mod 3 = 0 (and n is odd).
Note that if n is odd and divisible by 3, then it can be written as 3m where m is odd.
In fact 2n + 5n + 56 is divisible by 63 whenever n is odd, but a bit more thought is
needed to get the factor of 9 if n is not divisible by 3. If you feel brave you might start
by thinking about the statement ‘if n is odd and divisible by 3, you can write it as 3m
where m is odd’. How can we write n if it is odd but not divisible by 3? The way I
did it required two different forms depending on the value of n mod 3.
(iii) Show that 23n+1 + 3 × 52n+1 is divisible by 17.
Assignment 17 4