✦ VidyaVerseOpen in the book reader

Home › Books › High School Mathematics

Chapter 4: Number Theory: Divisibility, Primes and Modular Arithmetic

High School Mathematics · PART I — Number · by GS Shashidhara

Read in the book reader – search and larger text

KEY IDEA — Learning objectives

After studying this chapter you will be able to:

▪ state and prove the divisibility tests for 2, 3, 4, 5, 8, 9 and 11, and test for 7, 11 and 13 together;

▪ identify primes efficiently and use the Sieve of

Eratosthenes;

▪ use the extended Euclidean algorithm to write gcd(a, b) = ax + by (Bézout’s identity);

▪ solve linear Diophantine equations such as 7x + 5y = 100 in integers;

▪ calculate with congruences and find remainders and last digits of huge powers;

▪ apply Fermat’s little theorem, Wilson’s theorem and the Chinese Remainder Theorem;

▪ work with the number and sum of divisors, and with perfect numbers.

SYLLABUS LINK — Where this chapter fits

▪ NCERT/CBSE: Class 6–8 Playing with Numbers and divisibility; Class 10 Real Numbers (Euclid’s algorithm, FTA). Modular arithmetic is enrichment.

▪ ICSE: Class 9–10 foundations of HCF/LCM; divisibility.

▪ Cambridge IGCSE 0580: E1.1 Types of number (primes, factors, multiples, HCF, LCM).

▪ GCSE (England): N4 (prime factorisation, HCF, LCM).

▪ US Common Core: 6.NS.B.4 (GCF, LCM); number-theory enrichment.

▪ Olympiad (IOQM/RMO/INMO/IMO): a core area — congruences, Fermat, CRT and Diophantine equations appear every year.

4.1 Divisibility

We say that an integer a (≠ 0) divides an integer b, and write a ∣ b, if b = ak for some integer k. Then a is a divisor (factor) of b and b is a multiple of a. If a does not divide b we write a ∤ b. For example 6 ∣ 42, but 6 ∤ 40.

KEY IDEA — Basic properties of divisibility

For integers a, b, c (with divisors non-zero):

▪ a ∣ a, 1 ∣ a and a ∣ 0.

▪ If a ∣ b and b ∣ c, then a ∣ c (transitive).

▪ If a ∣ b and a ∣ c, then a ∣ (bx + cy) for all integers x, y (linear combinations).

▪ If a ∣ b and b ≠ 0, then ∣a∣ ≤ ∣b∣.

Proof of the linear-combination property. If b = ak and c = al, then bx + cy = a(kx + ly), which is a multiple of a. □

This one property is the engine of almost every divisibility proof in this chapter.

Example 4.1. Prove that n2 + n is even for every integer n.

Solution. n2 + n = n(n + 1) is the product of two consecutive integers.

One of any two consecutive integers is even, so the product is even.

∴ 2 ∣ n2 + n for every integer n. □

4.2 Tests of Divisibility

DivisorTest
2last digit is 0, 2, 4, 6 or 8
3sum of digits is divisible by 3
4number formed by the last two digits is divisible by 4
5last digit is 0 or 5
6divisible by both 2 and 3
8number formed by the last three digits is divisible by 8
9sum of digits is divisible by 9
10last digit is 0
11(sum of digits in odd places) − (sum of digits in even places),
DivisorTest

counting from the right, is divisible by 11

split the number into groups of three digits from the right; the

7, 11, 13 alternating sum of the groups is divisible by 7, 11 or 13

respectively

Why the tests for 3 and 9 work. Take a four-digit number N = 1000a + 100b + 10c + d. Then

N = 999a + 99b + 9c + (a + b + c + d).

The first three terms are multiples of 9 (and hence of 3), so N and its digit sum (a + b + c + d) leave the same remainder on division by 9 or by 3.

Why the test for 11 works. N = 1000a + 100b + 10c + d = (1001a + 99b + 11c) + (−a + b − c + d), and 1001 = 11 × 91, 99 = 11 × 9. So N and the alternating sum d − c + b − a leave the same remainder on division by 11.

Why the 7–11–13 test works. 1000 = 1001 − 1 and 1001 = 7 × 11 × 13.

Example 4.2. Test 8 724 312 for divisibility by 3, 4, 8, 9 and 11.

Solution. Digit sum = 8 + 7 + 2 + 4 + 3 + 1 + 2 = 27, divisible by both 3 and 9.

Last two digits 12 = 4 × 3, so divisible by 4. Last three digits 312 = 8 × 39, so divisible by 8.

Alternating sum from the right: 2 − 1 + 3 − 4 + 2 − 7 + 8 = 3, not divisible by 11.

∴ Divisible by 3, 4, 8 and 9 (and hence by 72); not by 11.

Example 4.3. Find the digit x so that the number 37x52 is divisible by (a) 9 (b) 11.

Solution. (a) Digit sum = 3 + 7 + x + 5 + 2 = 17 + x must be a multiple of 9, so 17 + x = 18 and x = 1.

(b) Alternating sum from the right: 2 − 5 + x − 7 + 3 = x − 7 must be a multiple of 11; with 0 ≤ x ≤ 9, x − 7 = 0.

∴ (a) x = 1 (37 152) (b) x = 7 (37 752).

Casting out nines

Because every number leaves the same remainder on division by 9 as its digit sum, we can check multiplication quickly. Reduce each factor to its repeated digit sum (its digital root); the product of the digital roots must have the same digital root as the answer.

Example 4.4. Use casting out nines to check that 4568 × 287 = 1 311 016.

Solution. 4568 → 4 + 5 + 6 + 8 = 23 → 5; 287 → 17 → 8; 5 × 8 = 40 → 4.

1 311 016 → 1 + 3 + 1 + 1 + 0 + 1 + 6 = 13 → 4. The digital roots agree.

∴ The answer passes the check. (Casting out nines detects most, but not all, errors — it cannot detect swapped digits.)

4.3 Prime Numbers

Recall that a prime has exactly two positive divisors, 1 and itself. There are 25 primes below 100:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,

71, 73, 79, 83, 89, 97.

KEY IDEA — The square-root test

If n > 1 has no prime factor p with p ≤ √n, then n is prime. Reason: if n = ab with 1 < a ≤ b, then a2 ≤ ab = n, so a ≤ √n, and any prime factor of a is also at most √n.

Example 4.5. Is 391 prime? Is 397 prime?

Solution. √391 ≈ 19.8 and √397 ≈ 19.9, so test the primes 2, 3, 5, 7, 11, 13, 17, 19.

391 = 17 × 23, so 391 is composite.

397 is not divisible by any of 2, 3, 5, 7, 11, 13, 17, 19

(remainders 1, 1, 2, 5, 1, 7, 6, 17).

∴ 391 is composite; 397 is prime.

FROM THE HISTORY OF MATHEMATICS — The Sieve of

Eratosthenes

Eratosthenes of Cyrene (c. 276–194 BCE), who also measured the circumference of the Earth, invented a simple way to list all primes up to N. Write the numbers 2 to N. Circle 2 and cross out all its other multiples; circle the next uncrossed number (3) and cross out its multiples; continue. You may stop once the circled number exceeds √N — every remaining number is prime. For N = 100 you need only sieve with 2, 3, 5 and 7.

Some famous primes and problems

▪ Twin primes are pairs of primes differing by 2: (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43), … Whether there are infinitely many is still unknown (the twin prime conjecture).

▪ Goldbach’s conjecture (1742): every even number greater than 2 is the sum of two primes, e.g. 100 = 3 + 97 = 11 + 89. It has been checked by computer up to 4 × 1018 but never proved.

▪ Mersenne primes are primes of the form 2p − 1: 3, 7, 31, 127, … Not every such number is prime: 211 − 1 = 2047 = 23 × 89. The largest known primes are Mersenne primes with tens of millions of digits.

▪ Every prime greater than 3 is of the form 6k ± 1, because 6k, 6k ± 2 and 6k + 3 are divisible by 2 or 3.

4.4 The GCD and Bézout’s Identity

In Chapter 1 we used Euclid’s algorithm to find gcd(a, b) (= HCF). Running the algorithm backwards gives much more.

KEY IDEA — Bézout’s identity

For any integers a and b, not both zero, there exist integers x and y such that

ax + by = gcd(a, b).

Moreover, gcd(a, b) is the smallest positive number of the form ax + by.

The method of finding x and y is called the extended Euclidean algorithm.

Example 4.6. Find gcd(240, 46) and express it in the form 240x + 46y.

Solution. Euclid’s algorithm:

240 = 5 × 46 + 10

46 = 4 × 10 + 6

10 = 1 × 6 + 4

6 = 1 × 4 + 2

4 = 2 × 2 + 0, so gcd = 2.

Work backwards, each time replacing the last remainder: 2 = 6 − 4 = 6 − (10 − 6) = 2 × 6 − 10

= 2(46 − 4 × 10) − 10 = 2 × 46 − 9 × 10

= 2 × 46 − 9(240 − 5 × 46) = 47 × 46 − 9 × 240.

∴ gcd(240, 46) = 2 = 240 × (−9) + 46 × 47. (Check: 2162 − 2160 = 2 )✓

Two integers a and b are coprime if gcd(a, b) = 1. A very useful consequence of Bézout’s identity is Euclid’s lemma: if a ∣ bc and gcd(a, b) = 1, then a ∣ c. (Proof: 1 = ax + by, so c = acx + bcy, and a divides both terms.)

4.5 Linear Diophantine Equations

An equation ax + by = c to be solved in integers is a linear Diophantine equation, named after Diophantus of Alexandria (c. 250 CE).

KEY IDEA — Solving ax + by = c

▪ It has integer solutions if and only if d = gcd(a, b) divides c.

▪ If (x0, y0) is one solution, all solutions are

x = x0 + (b/d)t, y = y0 − (a/d)t, t ∈ ℤ.

Example 4.7. Find all solutions of 7x + 5y = 100 in positive integers.

Solution. gcd(7, 5) = 1 divides 100, so solutions exist.

Reduce modulo 5: 7x ≡ 100 ≡ 0, so 2x is a multiple of 5, hence x = 5t.

Then 35t + 5y = 100 gives y = 20 − 7t.

Positivity: t ≥ 1 and 20 − 7t > 0 ⇒ t ≤ 2.

∴ (x, y) = (5, 13) or (10, 6).

Example 4.8. Can a postage of exactly ₹50 be made using only ₹6 and ₹9 stamps?

Solution. We need 6x + 9y = 50 with x, y ≥ 0. But gcd(6, 9) = 3, and 3 ∤ 50.

∴ No — every combination of ₹6 and ₹9 stamps is a multiple of ₹3.

HERITAGE OF INDIAN MATHEMATICS — Kuṭṭaka — the

“pulveriser”

In the Āryabhaṭīya (499 CE), Āryabhaṭa gave a method called kuṭṭaka (“pulverising”) for solving equations of the form ax + c = by in integers. The method repeatedly divides the larger number by the smaller — exactly the Euclidean algorithm — and then works back up the chain of quotients, just as in Example 4.6. Bhāskara I (629 CE), Brahmagupta (628 CE) and Bhāskara II (1150 CE) refined it and applied it to astronomy, for example to find when planets return to the same positions. Brahmagupta went further and solved the much harder equation Nx2 + 1 = y2 (now called Pell’s equation), and Bhāskara II’s cakravāla method solved it completely — centuries before European mathematicians.

4.6 Congruences and Modular Arithmetic

KEY IDEA — Definition (Gauss, 1801)

Let n be a positive integer. We say that a is congruent to b modulo n, and write

a ≡ b (mod n),

if n ∣ (a − b) — equivalently, if a and b leave the same remainder when divided by n.

Examples: 38 ≡ 3 (mod 7), since 38 − 3 = 35 = 5 × 7; 100 ≡ 1 (mod 9); −1 ≡ 12 (mod 13). Clock arithmetic is arithmetic modulo 12: nine hours after 8 o’clock it is 5 o’clock, because 8 + 9 = 17 ≡ 5 (mod 12).

KEY IDEA — Rules for congruences

If a ≡ b and c ≡ d (mod n), then

▪ a + c ≡ b + d, a − c ≡ b − d and ac ≡ bd (mod n);

▪ ak ≡ bk (mod n) for every positive integer k.

Division is not always allowed: 2 × 3 ≡ 2 × 8 (mod 10) but 3 ≡“ 8 (mod 10). You may cancel a factor c only when gcd(c, n) = 1.

Proof of the product rule. a = b + nk and c = d + nl, so ac = bd + n(bl + dk + nkl) ≡ bd (mod n). □

The power rule is what makes congruences so powerful: to find the remainder of a huge power, find a small power that is congruent to 1 or −1.

Example 4.9. Find the remainder when 2100 is divided by 7.

Solution. 23 = 8 ≡ 1 (mod 7).

2100 = 299 × 2 = (23)33 × 2 ≡ 133 × 2 = 2 (mod 7).

∴ Remainder 2.

Example 4.10. Prove that 3 ∣ n3 + 2n for every integer n.

Solution. Every integer is congruent to 0, 1 or 2 modulo 3. n ≡ 0: n3 + 2n ≡ 0. n ≡ 1: 1 + 2 = 3 ≡ 0. n ≡ 2: 8 + 4 = 12 ≡ 0 (mod 3).

∴ In every case 3 ∣ n3 + 2n. □

4.7 Remainders and Last Digits

The last digit of a number is its remainder modulo 10; its last two digits form its remainder modulo 100. Powers of any number eventually repeat their last digits in a cycle.

Last digit of baseCycle of last digits of powers Cycle length
0, 1, 5, 60; 1; 5; 6 (constant)1
44, 62
99, 12
Last digit of baseCycle of last digits of powers Cycle length
22, 4, 8, 64
33, 9, 7, 14
77, 9, 3, 14
88, 4, 2, 64

Example 4.11. Find the last two digits of 7100.

Solution. 72 = 49 and 74 = 2401 ≡ 1 (mod 100).

7100 = (74)25 ≡ 125 = 1 (mod 100).

∴ The last two digits are 01.

Example 4.12. Find the remainder when 1! + 2! + 3! + … + 100! is divided by 12.

Solution. For n ≥ 4, n! contains the factors 3 and 4, so 12 ∣ n!. The remainder is therefore that of 1! + 2! + 3! = 1 + 2 + 6 = 9.

∴ 9.

Example 4.13. If today is Monday, what day will it be 100 days from today?

Solution. 100 = 14 × 7 + 2, so 100 ≡ 2 (mod 7).

∴ Two days after Monday: Wednesday.

4.8 Fermat’s Little Theorem and Wilson’s Theorem

KEY IDEA — Fermat’s little theorem (1640)

If p is a prime and p ∤ a, then

ap−1 ≡ 1 (mod p).

Equivalently, ap ≡ a (mod p) for every integer a.

Idea of proof. The numbers a, 2a, 3a, …, (p − 1)a are all different modulo p and none is 0 (if ia ≡ ja then p ∣ (i − j)a, so p ∣ i − j by Euclid’s lemma). So they are just 1, 2, …, p − 1 in some order. Multiplying them all: ap−1(p − 1)! ≡ (p − 1)! (mod p), and cancelling (p − 1)! (which is coprime to p) gives ap−1 ≡ 1. □

Example 4.14. Find the remainder when 3100 is divided by 13.

Solution. By Fermat, 312 ≡ 1 (mod 13). 100 = 8 × 12 + 4, so 3100 ≡ 34 = 81 (mod 13).

81 = 6 × 13 + 3.

∴ Remainder 3. (A shortcut: 33 = 27 ≡ 1, so 3100 = (33)33 × 3 ≡ 3.)

KEY IDEA — Wilson’s theorem

A number p > 1 is prime if and only if (p − 1)! ≡ −1 (mod p).

For example 6! = 720 = 103 × 7 − 1, so 6! ≡ −1 (mod 7). The result was known to Ibn al-Haytham (c. 1000 CE), stated by John Wilson, and first proved by Lagrange in 1771.

Example 4.15. Find the remainder when 12! is divided by 13, and when 10! is divided by 11.

Solution. 13 and 11 are prime, so by Wilson’s theorem 12! ≡ −1 (mod 13) and 10! ≡ −1 (mod 11).

∴ 12! leaves remainder 12; 10! leaves remainder 10.

NOTE — Euler’s generalisation

For any n, let φ(n) be the number of integers from 1 to n that are coprime to n (Euler’s totient; e.g. φ(10) = 4, φ(125) = 100). Euler’s theorem says aφ(n) ≡ 1 (mod n) whenever gcd(a, n) = 1. For a prime p, φ(p) = p − 1 and this is Fermat’s theorem. If n = p1ap2b…, then φ(n) = n(1 − 1/p1)(1 − 1/p2)…

4.9 The Chinese Remainder Theorem

KEY IDEA — Chinese Remainder Theorem (CRT)

If n1, n2, …, nk are pairwise coprime, the system x ≡ a1 (mod n1), x ≡ a2 (mod n2), …, x ≡ ak (mod nk) has a solution, and the solution is unique modulo n1n2…nk.

The name comes from the Chinese text Sunzi Suanjing (3rd–5th century CE), which asks: “There are certain things whose number is unknown. Counted by threes, two are left over; by fives, three are

left over; by sevens, two are left over. How many things are there?” The same type of problem was solved in India with the kuṭṭaka.

Example 4.16. Solve Sunzi’s problem: x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7).

Solution. From the first and third congruences, x − 2 is divisible by 3 and by 7, so x ≡ 2 (mod 21): x = 2, 23, 44, 65, 86, …

Now choose the one with remainder 3 on division by 5: 2 → 2, 23 → 3 .✓

∴ x ≡ 23 (mod 105); the smallest positive answer is 23.

Example 4.17. Find the smallest positive number that leaves remainders 1, 2, 3, 4 and 5 when divided by 2, 3, 4, 5 and 6 respectively.

Solution. In each case the remainder is one less than the divisor, so N + 1 is divisible by 2, 3, 4, 5 and 6.

lcm(2, 3, 4, 5, 6) = 60, so N + 1 = 60.

∴ N = 59.

4.10 Divisors and Perfect Numbers

If n = p1ap2bp3c… is the prime factorisation of n, then (as in Chapter 1):

τ(n) = (a + 1)(b + 1)(c + 1)… (number of divisors)

σ(n) = (1 + p1 + … + p1a)(1 + p2 + … + p2b)… (sum of divisors)

A number is perfect if it equals the sum of its divisors other than itself, i.e. σ(n) = 2n. The first perfect numbers are 6 = 1 + 2 + 3, 28 = 1 + 2 + 4 + 7 + 14, 496 and 8128.

KEY IDEA — Euclid–Euler theorem

If 2p − 1 is prime, then 2p−1(2p − 1) is perfect (Euclid, Elements IX.36). Conversely, every even perfect number has this form (Euler, 18th century). Nobody knows whether any odd perfect number exists.

Example 4.18. Show that 496 is perfect.

Solution. 496 = 16 × 31 = 24 × 31, and 31 = 25 − 1 is prime.

σ(496) = (1 + 2 + 4 + 8 + 16)(1 + 31) = 31 × 32 = 992 = 2 × 496.

∴ 496 is perfect.

OLYMPIAD CORNER — A squares-modulo-4 argument

Every square is ≡ 0 or 1 (mod 4): (2k)2 = 4k2 and (2k + 1)2 = 4(k2 + k) + 1. Hence a sum of two squares is ≡ 0, 1 or 2 (mod 4), never 3. So numbers such as 3, 7, 11, 2027 can never be written as a sum of two squares. Looking at an equation modulo a cleverly chosen number is one of the most powerful tools in olympiad number theory.

Chapter Summary

▪ a ∣ b means b = ak; if a ∣ b and a ∣ c then a ∣ bx + cy.

▪ Divisibility tests follow from 10 ≡ 1 (mod 3 and 9), 10 ≡ −1 (mod 11), 1000 ≡ −1 (mod 7, 11, 13).

▪ n is prime if no prime p ≤ √n divides it. Every prime > 3 is 6k ± 1.

▪ Bézout: gcd(a, b) = ax + by for some integers x, y (extended Euclidean algorithm).

▪ ax + by = c is solvable in integers ⇔ gcd(a, b) ∣ c; general solution x0 + (b/d)t, y0 − (a/d)t.

▪ a ≡ b (mod n) ⇔ n ∣ a − b. Congruences can be added,

subtracted, multiplied and raised to powers.

▪ Fermat: ap−1 ≡ 1 (mod p) for p ∤ a. Wilson: (p − 1)! ≡ −1 (mod p). Euler: aφ(n) ≡ 1 (mod n).

▪ CRT: congruences with pairwise coprime moduli have a unique solution modulo the product.

▪ τ(n) = ∏(ai + 1); even perfect numbers are 2p−1(2p − 1) with 2p − 1 prime.

Exercise 4A — Foundation Problems

1. Test 2 345 678 for divisibility by 2, 3, 4, 5, 9 and 11.

2. Find the smallest digit that can replace in 456 so that the number is divisible by (a) 3 (b) 9.

3. Which of 1331, 9724, 85 921 and 12 345 are divisible by 11?

4. List all the primes between 50 and 100.

5. Decide whether each is prime: (a) 221 (b) 233 (c) 437.

6. Write two pairs of twin primes greater than 50.

7. Express 30, 50 and 100 each as a sum of two primes.

8. Find gcd(84, 126) and lcm(84, 126).

9. Find integers x and y such that 12x + 5y = 1.

10. Which are true? (a) 38 ≡ 3 (mod 7) (b) 100 ≡ 1 (mod 9) (c) 25 ≡ −1 (mod 13) (d) 17 ≡ 2 (mod 4).

11. Find the remainder when (a) 210 is divided by 7 (b) 520 is divided by 3.

12. Find the last digit of 32026.

13. Find the last digit of 92027.

14. Find the smallest number divisible by every whole number from 1 to 10.

15. Find the number and the sum of the divisors of 72.

16. Show that 6 and 28 are perfect numbers.

17. Use casting out nines to check 239 × 47 = 11 233.

18. Find the remainder when 1 234 567 is divided by (a) 9 (b) 11.

19. Is 211 − 1 prime?

20. Use the 7–11–13 test to decide whether 2 003 001 is divisible by 7, 11 or 13.

Exercise 4B — Standard Problems

1. Prove the divisibility test for 9 for any five-digit number.

2. Using congruences, prove that a number is divisible by 11 if and only if the alternating sum of its digits (from the right) is divisible by 11.

3. Find the digits a and b if the five-digit number 6a49b is divisible by 72.

4. Use the extended Euclidean algorithm to find gcd(1001, 221) and express it as 1001x + 221y.

5. Find all solutions of 3x + 7y = 50 in positive integers.

6. A farmer spends exactly ₹1500 on hens at ₹70 each and ducks at ₹110 each, buying at least one of each. How many of each could he have bought?

7. Find the remainder when 22026 is divided by 7.

8. Find the remainder when 350 + 550 is divided by 8.

9. Find the last two digits of 3100.

10. Prove that 13 divides 270 + 370.

11. Use Wilson’s theorem to find the remainder when 17! is divided by 19.

12. Find the smallest positive integer N with N ≡ 1 (mod 4), N ≡ 2 (mod 5) and N ≡ 3 (mod 7).

13. A woman carrying a basket of eggs finds that when she takes them out 2, 3, 4, 5 or 6 at a time, one egg is always left, but when she takes them 7 at a time, none is left. What is the least number of eggs in the basket?

14. How many positive divisors does 10! have?

15. Verify that 8128 = 26(27 − 1) is a perfect number.

Exercise 4C — Higher-Order Thinking Problems

1. Prove that p2 − 1 is divisible by 24 for every prime p > 3.

2. Prove that no integer of the form 4k + 3 is a sum of two squares.

3. Prove that 7 ∣ 23n − 1 for every natural number n.

4. Find the remainder when 22026 is divided by 17.

5. For an integer n, what are the possible values of gcd(n2 + 1, n + 1)?

6. Find the remainder when 12026 + 22026 + 32026 + 42026 is divided by 5.

7. Find the smallest positive integer x such that 17x ≡ 1 (mod 43).

8. Find the number of ordered pairs of positive integers (x, y) with 1/x + 1/y = 1/6.

9. Prove that there are infinitely many primes of the form 4k + 3.

10. Prove that the sum of the squares of three consecutive integers is never a perfect square.

Exercise 4D — Olympiad Problems

1. Find the last three digits of 22026.

2. Prove that n7 − n is divisible by 42 for every integer n.

3. Find all primes p such that p2 + 2 is also prime.

4. Find all primes p such that 2p + 1 and 4p + 1 are both prime.

5. How many integers from 1 to 1000 are divisible by none of 2, 3 and 5?

6. Show that n2 + n + 41 is not prime for every natural number n.

7. Find all integers n for which n + 2 divides n2 + 7.

8. Find all positive integers n for which 1! + 2! + … + n! is a perfect square.

9. Prove that 7 divides 32n+1 + 2n+2 for every non-negative integer n.

10. Find the remainder when 2100 is divided by 101.

11. In how many ways can 2026 be written as a sum of two or more consecutive positive integers?

12. Prove that if p is a prime and p ∣ ab, then p ∣ a or p ∣ b.

Exercise 4E — NCERT-Aligned Practice

These problems practise the number-play, HCF/LCM and algorithm skills of NCERT Grade 7, Grade 9 and Class 10. Tags name the matching NCERT chapter.

NOTE — Kaprekar’s routine and algorithms

▪ Kaprekar’s routine: take a four-digit number whose digits are not all equal. Arrange its digits in descending and in ascending order, and subtract the smaller number from the larger. Repeat. Within at most seven steps you reach 6174, Kaprekar’s constant, discovered by D. R. Kaprekar of Devlali, Maharashtra, in 1949. For three-digit numbers the fixed point is 495.

▪ An algorithm is a finite list of precise steps that always ends with an answer. Euclid’s division algorithm and Euclid’s subtraction algorithm both find the GCD: “replace the larger number by (larger − smaller)” also works, but it takes more steps.

1. [G7-I-6] Without adding, decide whether 17 + 38 + 91 + 46 + 23 is odd or even. Check by adding.

2. [G7-I-6] Can you choose five numbers from 1, 3, 5, …, 19 (repetition allowed) whose sum is 50? Explain.

3. [G7-I-6] Apply Kaprekar’s routine to 3524. How many steps does it take to reach 6174?

4. [G7-I-6] Apply the three-digit routine to 352 until you reach 495.

5. [G7-I-6] Find all two-digit numbers AB (with digits A, B ≥ 1) such that AB + BA = 121.

6. [C10-1, G9-11] Use Euclid’s division algorithm to find the HCF of 1260 and 7344.

7. [G9-11] Use Euclid’s subtraction algorithm to find gcd(84, 36). How many subtractions are needed?

8. [G7-II-3] Three bells ring at intervals of 12, 15 and 20 minutes. They ring together at 8:00 a.m. When do they next ring together?

9. [G7-II-3] A Noor measuring 6.72 m by 4.80 m is to be covered with identical square tiles, with no cutting. Find the largest possible tile and the number of tiles needed.

10. [G7-II-3] Find the smallest number greater than 12 that leaves remainder 5 when divided by 6, 8 or 12.

11. [G7-I-6] The numbers 1 to 9 are placed in a 3 × 3 grid so that every row, column and diagonal sums to 15. Prove that the centre must be 5.

12. [G9-11] To test whether 221 is prime, which divisors do you need to try? Is 221 prime?

13. [C10-1] How many positive divisors does 360 have?

14. [G7-I-6] Prove that the product of any three consecutive integers is divisible by 6.

Brain Teasers

1. Think of any number, multiply it by 9, then add the digits of the answer repeatedly until one digit remains. Why is the result always 9?

2. Write any three-digit number twice to make a six-digit number, such as 637 637. Why is the result always divisible by 7, 11 and 13?

3. How many even primes are there?

4. If 1 January of a non-leap year is a Monday, what day is 31 December?

5. 100 lockers are closed. Student 1 opens every locker; student 2 toggles every 2nd locker; student 3 toggles every 3rd; and so on up to student 100. Which lockers end up open?

6. Why is 1729 called the Hardy–Ramanujan number?

7. Compute 12 345 679 × 9 and 12 345 679 × 18. Explain.

8. It is 8 o’clock. What time will it be 9 hours later? 100 hours later?

9. A number consists of 2026 ones: 111…1. Is it divisible by 11? By 3?

10. A shopkeeper has packs of 6, 9 and 20 nuggets. What is the largest number of nuggets that cannot be bought exactly?

Multiple-Choice Questions

1. A number is divisible by 9 if: (a) the sum of its digits is divisible by 9 (b) its last digit is 9 (c) it is odd (d) its last two digits are divisible by 9

2. The number of primes less than 50 is: (a) 14 (b) 25 (c) 16 (d) 15

3. gcd(17, 51) is: (a) 1 (b) 3 (c) 17 (d) 51

4. 23 ≡ ? (mod 5): (a) 2 (b) 3 (c) 4 (d) 0

5. The last digit of 210 is: (a) 4 (b) 2 (c) 6 (d) 8

6. The remainder when 1010 is divided by 9 is: (a) 0 (b) 1 (c) 9 (d) 10

7. “ap−1 ≡ 1 (mod p) for prime p not dividing a” is: (a) Wilson’s theorem (b) Euclid’s lemma (c) Fermat’s little theorem (d) CRT

8. The number of divisors of 36 is: (a) 9 (b) 8 (c) 6 (d) 12

9. Which is a perfect number? (a) 12 (b) 36 (c) 30 (d) 28

10. (p − 1)! ≡ −1 (mod p) for prime p is: (a) Fermat’s theorem (b) Bézout’s identity (c) Wilson’s theorem (d) Euler’s theorem

11. The solution of 7x ≡ 1 (mod 10) with 0 ≤ x < 10 is: (a) 3 (b) 7 (c) 1 (d) 9

12. Which number is prime? (a) 91 (b) 89 (c) 87 (d) 93

13. ax + by = c has integer solutions exactly when: (a) a ∣ c (b) c > 0

(c) lcm(a, b) ∣ c (d) gcd(a, b) ∣ c

14. The remainder when 220 is divided by 3 is: (a) 0 (b) 1 (c) 2 (d) 20

15. Every six-digit number of the form abcabc is divisible by: (a) 17

(b) 101 (c) 1001 (d) 19

Solutions to Chapter 4

Solutions — Exercise 4A

1. Last digit 8: divisible by 2, not by 5. Digit sum 2 + 3 + 4 + 5 + 6 + 7 + 8 = 35: not divisible by 3 or 9. Last two digits 78 = 4 × 19 + 2: not divisible by 4. Alternating sum 8 − 7 + 6 − 5 + 4 − 3 + 2 = 5: not divisible by 11.

∴ Divisible by 2 only.

2. Digit sum = 4 + x + 5 + 6 = 15 + x.

(a) 15 + x divisible by 3: smallest x = 0 (4056). (b) 15 + x divisible by 9: x = 3 (4356).

∴ (a) 0 (b) 3.

3. Alternating sums from the right: 1331: 1 − 3 + 3 − 1 = 0 .✓

9724: 4 − 2 + 7 − 9 = 0 . 85 921: 1 − 2 + 9 − 5 + 8 = 11 . 12✓✓

345: 5 − 4 + 3 − 2 + 1 = 3 .✗

∴ 1331, 9724 and 85 921 (but not 12 345).

4. Sieve between 50 and 100 using 2, 3, 5, 7.

∴ 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 (ten primes).

5. (a) 221 = 13 × 17, composite. (b) √233 < 16; 233 is not divisible by 2, 3, 5, 7, 11, 13 — prime. (c) 437 = 19 × 23, composite. ∴ Only 233 is prime.

6. Several answers are possible; for example:

∴ For example (59, 61) and (71, 73).

7. Several answers are possible; for example:

∴ 30 = 7 + 23 (or 11 + 19, 13 + 17); 50 = 3 + 47 (or 7 + 43, 13 + 37, 19 + 31); 100 = 3 + 97 (or 11 + 89, …).

8. 84 = 22 × 3 × 7, 126 = 2 × 32 × 7. gcd = 2 × 3 × 7 = 42; lcm = 22 × 32 × 7 = 252.

∴ gcd = 42, lcm = 252.

9. 12 = 2 × 5 + 2, 5 = 2 × 2 + 1, so 1 = 5 − 2 × 2 = 5 − 2(12 − 2 ×

5) = 5 × 5 − 2 × 12.

∴ x = −2, y = 5 (other answers: x = −2 + 5t, y = 5 − 12t).

10. (a) 35 = 5 × 7 (b) 99 = 11 × 9 (c) 26 = 2 × 13 (d) 15 is not✓✓✓

a multiple of 4 .✗

∴ (a), (b), (c) are true; (d) is false.

11. (a) 23 ≡ 1 (mod 7), so 210 = 29 × 2 ≡ 2. (b) 5 ≡ −1 (mod 3), so 520 ≡ (−1)20 = 1.

∴ (a) 2 (b) 1.

12. Cycle 3, 9, 7, 1 (length 4); 2026 ≡ 2 (mod 4).

∴ 9.

13. Powers of 9 end in 9 (odd power) or 1 (even power); 2027 is odd. ∴ 9.

14. lcm(1, …, 10) = 23 × 32 × 5 × 7.

∴ 2520.

15. 72 = 23 × 32: τ = 4 × 3 = 12; σ = (1 + 2 + 4 + 8)(1 + 3 + 9) = 15 × 13.

∴ 12 divisors; sum 195.

16. 6: 1 + 2 + 3 = 6. 28: 1 + 2 + 4 + 7 + 14 = 28.

∴ Both are perfect.

17. 239 → 14 → 5; 47 → 11 → 2; 5 × 2 = 10 → 1. 11 233 → 1 + 1 + 2 + 3 + 3 = 10 → 1.

∴ The check is passed (and indeed 239 × 47 = 11 233).

18. (a) Digit sum 28 → remainder 28 mod 9 = 1. (b) Alternating sum 7 − 6 + 5 − 4 + 3 − 2 + 1 = 4.

∴ (a) 1 (b) 4.

19. 2047 = 23 × 89.

∴ No — so 2p − 1 need not be prime even when p is prime.

20. Groups from the right: 2 | 003 | 001. Alternating sum: 001 − 003 + 2 = 0.

∴ 0 is divisible by 7, 11 and 13, so 2 003 001 is divisible by all three (2 003 001 = 1001 × 2001).

Solutions — Exercise 4B

1. N = 104a + 103b + 102c + 10d + e = 9999a + 999b + 99c + 9d + (a + b + c + d + e).

9999, 999, 99 and 9 are multiples of 9, so 9 ∣ N ⇔ 9 ∣ (a + b + c + d + e).

∴ Proved.

2. Since 10 ≡ −1 (mod 11), 10k ≡ (−1)k. So N = Σ dk10k ≡ Σ dk(−1)k = d0 − d1 + d2 − … (mod 11).

∴ N and its alternating digit sum leave the same

remainder, which proves the test.

3. 72 = 8 × 9 with gcd(8, 9) = 1. Divisibility by 8: 49b must be divisible by 8; 496 = 8 × 62, so b = 6.

Divisibility by 9: 6 + a + 4 + 9 + 6 = 25 + a must be 27, so a = 2.

∴ a = 2, b = 6 (62 496 = 72 × 868).

4. 1001 = 4 × 221 + 117; 221 = 1 × 117 + 104; 117 = 1 × 104 + 13; 104 = 8 × 13. gcd = 13.

13 = 117 − 104 = 117 − (221 − 117) = 2 × 117 − 221 = 2(1001 − 4 × 221) − 221 = 2 × 1001 − 9 × 221.

∴ gcd = 13 = 1001 × 2 + 221 × (−9).

5. Modulo 7: 3x ≡ 50 ≡ 1, and since 3 × 5 = 15 ≡ 1, x ≡ 5 (mod 7). So x = 5 + 7t and y = (50 − 3x)/7 = 5 − 3t.

Positive: t = 0 gives (5, 5); t = 1 gives (12, 2); t = 2 gives y < 0.

∴ (5, 5) and (12, 2).

6. 70h + 110d = 1500 ⇒ 7h + 11d = 150. Modulo 7: 11d ≡ 4d ≡ 150 ≡ 3, so d ≡ 6 (mod 7) (as 4 × 6 = 24 ≡ 3).

d = 6: 7h = 84, h = 12. d = 13: 7h = 7, h = 1. d = 20: 7h < 0. ∴ 12 hens and 6 ducks, or 1 hen and 13 ducks.

7. 23 ≡ 1 (mod 7) and 2026 = 3 × 675 + 1.

∴ 22026 ≡ 21 = 2.

8. 32 = 9 ≡ 1 and 52 = 25 ≡ 1 (mod 8), so 350 ≡ 1 and 550 ≡ 1. ∴ Remainder 2.

9. 310 = 59 049 ≡ 49 (mod 100), so 320 ≡ 492 = 2401 ≡ 1 (mod 100). ∴ 3100 = (320)5 ≡ 1, so the last two digits are 01.

10. Modulo 13: 212 ≡ 1 (Fermat), so 272 ≡ 1 and 270 ≡ 2−2, the inverse of 4. Since 4 × 10 = 40 ≡ 1, 270 ≡ 10. Also 33 = 27 ≡ 1, so 370 = (33)23 × 3 ≡ 3.

∴ 270 + 370 ≡ 10 + 3 = 13 ≡ 0 (mod 13). □

11. Wilson: 18! ≡ −1 (mod 19). But 18! = 18 × 17! and 18 ≡ −1, so −17! ≡ −1.

∴ 17! ≡ 1 (mod 19); remainder 1.

12. Numbers ≡ 3 (mod 7): 3, 10, 17, … ; of these, 17 ≡ 2 (mod 5) and 17 ≡ 1 (mod 4).

∴ N = 17 (and all N ≡ 17 mod 140).

13. N ≡ 1 (mod 2, 3, 4, 5, 6) ⇔ N ≡ 1 (mod 60), so N = 61, 121, 181, 241, 301, … The first multiple of 7 in this list is 301 = 7 × 43. ∴ 301 eggs.

14. 10! = 28 × 34 × 52 × 7 (count factors: 2s: 5 + 2 + 1 = 8; 3s: 3 + 1 = 4; 5s: 2; 7s: 1).

∴ τ(10!) = 9 × 5 × 3 × 2 = 270.

15. 27 − 1 = 127 is prime. σ(8128) = (1 + 2 + … + 64) × (1 + 127) = 127 × 128 = 16 256 = 2 × 8128.

∴ 8128 is perfect.

Solutions — Exercise 4C

1. p2 − 1 = (p − 1)(p + 1). Since p is odd, p − 1 and p + 1 are consecutive even numbers; one of them is divisible by 4, so the product is divisible by 2 × 4 = 8.

Since p > 3 is not a multiple of 3, one of p − 1, p + 1 is a multiple of 3.

∴ As gcd(8, 3) = 1, 24 ∣ p2 − 1. (Check: 72 − 1 = 48 = 2 × 24.)

2. Squares are ≡ 0 or 1 (mod 4) (Olympiad Corner, Section 4.10), so x2 + y2 ≡ 0, 1 or 2 (mod 4).

∴ A number ≡ 3 (mod 4) can never be x2 + y2.

3. 23 = 8 ≡ 1 (mod 7), so 23n = 8n ≡ 1n = 1.

∴ 7 ∣ 23n − 1.

4. 24 = 16 ≡ −1 (mod 17), so 28 ≡ 1. 2026 = 8 × 253 + 2.

∴ 22026 ≡ 22 = 4.

5. n2 + 1 = (n + 1)(n − 1) + 2, so gcd(n2 + 1, n + 1) = gcd(n + 1, 2). ∴ 2 if n is odd, 1 if n is even.

6. By Fermat, a4 ≡ 1 (mod 5) for a = 1, 2, 3, 4. 2026 = 4 × 506 + 2, so a2026 ≡ a2.

∴ Sum ≡ 1 + 4 + 9 + 16 = 30 ≡ 0; remainder 0.

7. Extended Euclid: 43 = 2 × 17 + 9; 17 = 1 × 9 + 8; 9 = 1 × 8 + 1. Back-substitute: 1 = 9 − 8 = 9 − (17 − 9) = 2 × 9 − 17 = 2(43 − 2 × 17) − 17 = 2 × 43 − 5 × 17.

So 17 × (−5) ≡ 1 (mod 43), and −5 ≡ 38.

∴ x = 38 (check: 17 × 38 = 646 = 15 × 43 + 1).

8. Clear fractions: 6y + 6x = xy ⇒ xy − 6x − 6y + 36 = 36 ⇒ (x − 6) (y − 6) = 36.

Both x, y > 6 (if x ≤ 6, 1/x ≥ 1/6 and 1/y would be ≤ 0). So x − 6 and y − 6 are positive divisors of 36, which has τ(36) = 9 divisors.

∴ 9 ordered pairs, e.g. (7, 42), (8, 24), (9, 18), (10, 15), (12, 12), (15, 10), (18, 9), (24, 8), (42, 7).

9. Suppose there are only finitely many such primes p1, …, pk. Let N = 4p1p2…pk − 1 ≡ 3 (mod 4). N is odd, and a product of numbers all ≡ 1 (mod 4) is ≡ 1 (mod 4); so N has a prime factor q ≡ 3 (mod 4). But q cannot be any pi: if pi ∣ N, then since pi ∣ 4p1…pk we would get pi ∣ 1. So q is a prime of the form 4k + 3 missing from our list — a contradiction.

∴ There are infinitely many primes of the form 4k + 3. □

10. (n − 1)2 + n2 + (n + 1)2 = 3n2 + 2 ≡ 2 (mod 3). Squares are ≡ 0 or 1 (mod 3) (Chapter 1, Exercise 1B Q11).

∴ So the sum is never a perfect square.

Solutions — Exercise 4D

1. Work modulo 8 and modulo 125 (1000 = 8 × 125, coprime). Modulo 8: 22026 ≡ 0.

Modulo 125: φ(125) = 100, so 2100 ≡ 1 and 22026 ≡ 226. Now 27 = 128 ≡ 3, so 226 = (27)3 × 25 ≡ 27 × 32 = 864 ≡ 114 (mod 125).

Find x < 1000 with x ≡ 114 (mod 125) and x ≡ 0 (mod 8): try 114, 239, 364, 489, 614, 739, 864 — and 864 = 8 × 108 .✓ ∴ The last three digits are 864.

2. 42 = 2 × 3 × 7. By Fermat’s little theorem, n7 ≡ n (mod 7), so 7 ∣ n7 − n. Also n7 − n = n(n6 − 1) = n(n2 − 1)(n4 + n2 + 1) = (n − 1)n(n + 1)(n4 + n2 + 1), which contains the product of three consecutive integers and so is divisible by 2 and 3.

∴ Divisible by 2, 3 and 7, hence by 42. □

3. p = 2: 6, not prime. p = 3: 11, prime . If p > 3, p ≡“ 0 (mod 3), so✓ p2 ≡ 1 and p2 + 2 ≡ 0 (mod 3), and p2 + 2 > 3 is composite. ∴ p = 3 only.

4. p = 2: 5 and 9 (9 not prime). p = 3: 7 and 13 . If p > 3: p ≡ 1✓ (mod 3) ⇒ 2p + 1 ≡ 0; p ≡ 2 (mod 3) ⇒ 4p + 1 ≡ 9 ≡ 0. One of them is a multiple of 3 greater than 3.

∴ p = 3 only.

5. Inclusion–exclusion. Multiples of 2, 3, 5: 500, 333, 200. Of 6, 10, 15: 166, 100, 66. Of 30: 33.

Divisible by at least one = 500 + 333 + 200 − 166 − 100 − 66 + 33 = 734.

∴ 1000 − 734 = 266.

6. Take n = 40: 402 + 40 + 41 = 40 × 41 + 41 = 412 = 1681. ∴ Not always prime (although it is prime for n = 0, 1, …, 39 — Euler’s famous polynomial).

7. n2 + 7 = (n + 2)(n − 2) + 11, so n + 2 ∣ 11: n + 2 ∈ {±1, ±11}. ∴ n = −13, −3, −1, 9.

8. n = 1: 1 = 12 . n = 2: 3 . n = 3: 9 = 3✓✗2 . n = 4: 33 . For n ≥ 5,✓✗

every k! with k ≥ 5 ends in 0, so the sum ends in the same digit as 33, i.e. 3. No square ends in 3.

∴ n = 1 and n = 3.

9. 32n+1 = 3 × 9n ≡ 3 × 2n and 2n+2 = 4 × 2n (mod 7).

∴ Sum ≡ 7 × 2n ≡ 0 (mod 7). □

10. 101 is prime and 101 ∤ 2. By Fermat, 2100 ≡ 1 (mod 101). ∴ Remainder 1.

11. If k consecutive integers starting at a sum to 2026, then k(2a + k − 1)/2 = 2026, i.e. k(2a + k − 1) = 4052 = 22 × 1013 (1013 is prime). The two factors have opposite parity, and k ≥ 2 is the smaller one.

Factor pairs (k, m) with k < m: (1, 4052), (2, 2026), (4, 1013). Only (4, 1013) has k ≥ 2 and opposite parity: 2a + 3 = 1013 ⇒ a = 505.

∴ Exactly one way: 2026 = 505 + 506 + 507 + 508.

12. Suppose p ∤ a. Then gcd(p, a) = 1 (the only divisors of p are 1 and p). By Euclid’s lemma (Section 4.4), p ∣ ab and gcd(p, a) = 1 imply p ∣ b.

∴ Proved. (This is the key step in proving the

uniqueness part of the Fundamental Theorem of

Arithmetic.)

Solutions — Exercise 4E

1. Only the odd terms matter: 17, 91 and 23 are three odd numbers. An odd count of odd numbers gives an odd sum. Check: 17 + 38 + 91 + 46 + 23 = 215.

∴ Odd (215).

2. Each number is odd, and the sum of five odd numbers is odd. But 50 is even.

∴ No, it is impossible.

3. 5432 − 2345 = 3087; 8730 − 0378 = 8352; 8532 − 2358 = 6174.

∴ 3 steps.

4. 532 − 235 = 297; 972 − 279 = 693; 963 − 369 = 594; 954 − 459 = 495.

∴ Four steps to 495.

5. AB + BA = (10A + B) + (10B + A) = 11(A + B) = 121, so A + B = 11.

∴ 29, 38, 47, 56, 65, 74, 83, 92.

6. 7344 = 5 × 1260 + 1044.

1260 = 1 × 1044 + 216.

1044 = 4 × 216 + 180.

216 = 1 × 180 + 36.

180 = 5 × 36 + 0.

∴ HCF = 36.

7. (84, 36) → (48, 36) → (12, 36) → (12, 24) → (12, 12).

∴ gcd = 12, after 4 subtractions.

8. 12 = 22 × 3, 15 = 3 × 5, 20 = 22 × 5, so LCM = 22 × 3 × 5 = 60 minutes.

∴ At 9:00 a.m.

9. In centimetres the Noor is 672 by 480. HCF(672, 480): 672 = 480 + 192; 480 = 2 × 192 + 96; 192 = 2 × 96.

The tile side is 96 cm. Number of tiles = (672/96) × (480/96) = 7 × 5.

∴ Tiles of side 96 cm; 35 tiles.

10. LCM(6, 8, 12) = 24, so the number has the form 24k + 5. With k = 1 it is 29.

∴ 29.

11. The four lines through the centre c (the middle row, the middle column and both diagonals) have total 4 × 15 = 60.

Together they cover every cell once, except the centre, which is counted four times. So 60 = 45 + 3c.

∴ c = 5. □

12. If 221 = ab with 1 < a ≤ b, then a ≤ √221 < 15. So it is enough to try the primes 2, 3, 5, 7, 11 and 13.

221 ÷ 13 = 17.

∴ Not prime: 221 = 13 × 17.

13. 360 = 23 × 32 × 5. The number of divisors is (3 + 1)(2 + 1)(1 + 1).

∴ 24.

14. Among any two consecutive integers one is even. Among any three consecutive integers one is a multiple of 3.

So the product is divisible by both 2 and 3, which are coprime, and hence by 6.

∴ Proved. □

Solutions — Brain Teasers

1. A multiple of 9 has a digit sum that is a multiple of 9; repeating, we reach a single-digit multiple of 9, which is 9 (unless the number was 0).

∴ Digital roots of multiples of 9 are always 9.

2. abcabc = abc × 1000 + abc = abc × 1001 = abc × 7 × 11 × 13. ∴ Because 1001 = 7 × 11 × 13.

3. Any even number greater than 2 is divisible by 2.

∴ Exactly one: 2.

4. 31 December is day 365, and 365 − 1 = 364 = 52 × 7.

∴ Monday.

5. Locker n is toggled once for each divisor of n. It ends open if it is toggled an odd number of times, i.e. if τ(n) is odd, which happens exactly when n is a perfect square (divisors pair up as d and n/d except √n).

∴ Lockers 1, 4, 9, 16, 25, 36, 49, 64, 81, 100.

6. G. H. Hardy visited Srinivasa Ramanujan in hospital in a taxi numbered 1729 and remarked that it was a dull number. Ramanujan replied that it is the smallest number expressible as a sum of two cubes in two different ways.

∴ 1729 = 13 + 123 = 93 + 103.

7. 12 345 679 × 9 = 111 111 111 and × 18 = 222 222 222. Since 111 111 111 = 9 × 12 345 679, multiplying by 9k gives k repeated nine times.

∴ The repeated-digit pattern works for 9, 18, 27, …, 81.

8. 8 + 9 = 17 ≡ 5 (mod 12); 8 + 100 = 108 ≡ 0 (mod 12), i.e. 12 o’clock.

∴ 5 o’clock; 12 o’clock.

9. 11 ∣ 11, so 11 divides 1111…1 with an even number of ones (it is 11 × 10101…01). The digit sum is 2026 ≡ 1 (mod 3).

∴ Divisible by 11; not divisible by 3.

10. Using 6s and 9s gives all multiples of 3 from 6 on; adding one or two 20s covers the other residues: numbers ≡ 2 (mod 3) are reachable from 20 onwards, and numbers ≡ 1 (mod 3) from 40 onwards. Checking, 43 cannot be made (43, 23 and 3 are not sums of 6s and 9s), but 44 = 20 + 24, 45 = 9 × 5, 46 = 40 + 6, 47 = 20 + 27, 48 = 6 × 8, 49 = 40 + 9, and every larger number follows by adding 6s.

∴ 43 (the famous McNugget number).

Solutions — Multiple-Choice Questions

1. This is the standard result stated in the chapter.

∴ (a).

2. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47.

∴ (d) 15.

3. 51 = 3 × 17.

∴ (c) 17.

4. 23 = 4 × 5 + 3.

∴ (b) 3.

5. 210 = 1024.

∴ (a) 4.

6. 10 ≡ 1 (mod 9).

∴ (b) 1.

7. This is the standard result stated in the chapter.

∴ (c) Fermat’s little theorem.

8. 36 = 22 × 32: 3 × 3.

∴ (a) 9.

9. 1 + 2 + 4 + 7 + 14 = 28.

∴ (d) 28.

10. This is the standard result stated in the chapter.

∴ (c) Wilson’s theorem.

11. 7 × 3 = 21 ≡ 1 (mod 10).

∴ (a) 3.

12. 91 = 7 × 13, 87 = 3 × 29, 93 = 3 × 31.

∴ (b) 89.

13. This is the standard result stated in the chapter. ∴ (d) gcd(a, b) ∣ c.

14. 2 ≡ −1 (mod 3), so 220 ≡ 1.

∴ (b) 1.

15. abcabc = abc × 1001.

∴ (c) 1001.