PART I — NUMBER SYSTEMS & ARITHMETIC
Primality Tests, Prime Families, Prime Gaps, and Deep Number Theory
1. Review and deepen understanding of prime and composite numbers.
2. Apply systematic primality tests (trial division up to square root).
3. Use shortcut primality tests including the 6k±1 rule.
4. Identify and study special families of primes: Mersenne, Fermat, twin, cousin, sexy.
5. Understand prime gaps and the distribution of primes (prime number theorem).
6. Apply primes in cryptography and real-world security contexts.
7. Explore composite numbers: highly composite, smooth numbers, and semi-primes.
8. Use properties of primes to solve digit puzzles and number theory problems.
9. Understand and apply Wilson’s Theorem and Fermat’s Little Theorem.
10. Solve olympiad-level problems on primes, composites, and their properties.
13.1 Primes and Composites — A Deeper Look
In Chapter 12 we introduced primes and composites. Now we explore them in far greater depth — their patterns, families, mysteries, and surprising applications.
QUICK REVIEW:
PRIME: Exactly 2 factors (1 and itself). Examples: 2, 3, 5, 7, 11, ...
COMPOSITE: 3 or more factors. Examples: 4, 6, 8, 9, 12, ...
1: Neither prime nor composite (exactly 1 factor).
0: Neither prime nor composite (infinitely many factors? No: 0÷k=0 for all k≠1).
WHY PRIMES MATTER:
• Primes are the "atoms" of arithmetic (Fundamental Theorem of Arithmetic).
• Every number is built from primes by multiplication.
• Large primes protect internet banking, WhatsApp messages, and Aadhaar data.
• Prime gaps and distributions connect to the deepest unsolved problems in maths.
• Primes appear in nature: cicada life cycles (13 and 17 years) are prime!
PRIMES vs COMPOSITES: A SUMMARY TABLE
Feature | Primes | Composites
Factors | Exactly 2 | 3 or more
Smallest | 2 | 4
Even examples | Only 2 | 4,6,8,10,12,...
Odd examples | 3,5,7,11,... | 9,15,21,25,...
Infinite supply? | Yes (Euclid proved) | Yes (all n≥4 except primes)
13.2 Testing Whether a Number Is Prime
How do we know if a given number is prime? Several methods exist, from simple to sophisticated.
Method 1: Trial Division up to √N
TRIAL DIVISION ALGORITHM:
Step 1: If N is even and N > 2, it is composite (divisible by 2).
Step 2: If sum of digits divisible by 3 and N > 3, it is composite.
Step 3: Test odd numbers from 3 upward: 3, 5, 7, 9, 11, ..., up to √N.
Step 4: If none divide N exactly, N is prime.
Note: You only need to test PRIME divisors (skip composites like 9, 15, 21, ...).
TIME: For an n-digit number, you test roughly √(10^n)/2 numbers.
4-digit number: test up to √9999 ≈ 100 → ≈50 divisors to check.
10-digit number: test up to √10^10 ≈ 100,000 → ≈10,000 primes to check.
For very large numbers (100+ digits), trial division is too slow!
Cryptographers use faster probabilistic methods (Miller-Rabin test).
Method 2: The 6k ± 1 Rule
THE 6k ± 1 RULE:
Every prime > 3 is of the form 6k+1 or 6k−1 for some positive integer k.
WHY? Consider any integer N. When divided by 6, the remainder is 0,1,2,3,4, or 5.
Remainder 0: N = 6k → divisible by 6. Composite (unless N=2 or 3).
Remainder 2: N = 6k+2 → divisible by 2. Composite.
Remainder 3: N = 6k+3 → divisible by 3. Composite.
Remainder 4: N = 6k+4 → divisible by 2. Composite.
Only remainders 1 and 5 (= 6k+1 and 6k+5 = 6(k+1)−1) can be prime!
Examples: 6(1)+1=7 (prime); 6(1)−1=5 (prime); 6(2)+1=13 (prime); 6(2)−1=11 (prime).
6(4)−1=23 (prime); 6(4)+1=25=5² (composite! The rule says NECESSARY, not
SUFFICIENT).
QUICK TEST: Is 97 prime?
97 = 6×16+1. So it could be prime. Test: √97≈9.8.
Test primes 2,3,5,7: 97÷2 (odd), ÷3 (9+7=16), ÷5 (no), ÷7=13.8 (no).
97 is PRIME. ✓
★ Maths Tip: QUICK PRIMALITY CHECK: First verify the number is of form 6k±1. If not, it is immediately composite (unless 2 or 3). Then trial divide by primes up to √N. This cuts your work roughly in third!
13.3 Families of Prime Numbers
Primes can be grouped into fascinating families based on their form or relationship to other primes.
| Family Name | Definition | First Few Members | Status / Open Problem |
|---|---|---|---|
| Twin Primes | Pairs (p, p+2) both | (3,5),(5,7),(11,13), | Are there infinitely many? |
| prime. | (17,19),(41,43) | UNSOLVED. | |
| Cousin Primes | Pairs (p, p+4) both | (3,7),(7,11),(13,17), | Infinite? UNSOLVED. |
| prime. | (37,41),(43,47) | ||
| Sexy Primes | Pairs (p, p+6) both | (5,11),(7,13),(11,17), | Infinite? UNSOLVED. |
| prime. | (13,19),(17,23) |
Mersenne Primes Primes of form 2^p−1 3,7,31,127,8191,131071,. 51 known. Infinite? UNSOLVED.
| Family Name | Definition | First Few Members | Status / Open Problem |
|---|---|---|---|
| (p prime) | .. |
Fermat Primes Primes of form 2^(2^n) 3,5,17,257,65537 (only 5 No more Fermat primes known
| +1 | known) | after F_4. |
| Sophie Germain p and 2p+1 both prime. 2,3,5,11,23,29,41,53,83,8 | Infinite? UNSOLVED. |
9
| Safe Primes | Primes p where (p−1)/2 5,7,11,23,47,59,83,107 | Used in cryptography. |
is also prime.
| Palindrome | Primes that read same 2,3,5,7,11,101,131,151,1 11 is the only 2-digit palindrome | ||
| Primes | forward/backward. | 81,191 | prime. |
| Emirp Primes | Primes whose digit- 13→31,17→71,31→13,3 Not palindromes; reversals are | ||
| reversal is different | 7→73 | different primes. |
prime.
Circular Primes All rotations of digits 2,3,5,7,11,13,17,31,37,71 197,199 are larger examples.
| are prime. | ,73,79,97 |
13.4 Prime Gaps — Spaces Between Consecutive Primes
The prime gap after prime p is the difference between p and the next prime. Prime gaps can be as small as 2 (twin primes) or arbitrarily large.
PRIME GAPS TABLE:
p=2: next prime=3. Gap=1.
p=3: next prime=5. Gap=2.
p=5: next prime=7. Gap=2.
p=7: next prime=11. Gap=4.
p=11: next prime=13. Gap=2.
p=13: next prime=17. Gap=4.
p=23: next prime=29. Gap=6.
p=89: next prime=97. Gap=8.
LARGE PRIME GAPS:
Between 113 and 127: gap = 14.
Between 887 and 907: gap = 20.
Between 9,551 and 9,587: gap = 36.
Between 31,397 and 31,469: gap = 72.
ARBITRARILY LARGE GAPS:
For any n, there exists a prime gap of at least n.
Proof: The n consecutive numbers (n+1)!+2, (n+1)!+3, ..., (n+1)!+(n+1)
are all composite! (k divides (n+1)!+k for 2≤k≤n+1).
Example: 3!+2=8, 3!+3=9, 3!+4=10 are all composite.
This proves we can find arbitrarily long "prime deserts".
Primes up to 150 (in gold) — notice the varying gaps between consecutive primes:
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
Observe: Twin prime pairs appear close together; larger gaps appear around 120–130, where primes seem rarer.
13.5 The Prime Number Theorem — How Primes Are Distributed
How many primes are there up to N? The prime number theorem gives an approximate answer.
PRIME NUMBER THEOREM (PNT):
The number of primes up to N, written π(N), is approximately N / ln(N).
π(N) ≈ N / ln(N) (where ln is the natural logarithm)
More accurately: π(N) ≈ Li(N) = ∫_2^N 1/ln(t) dt (logarithmic integral)
EXAMPLES:
π(100) = 25 (exact); 100/ln(100) = 100/4.605 ≈ 21.7 (estimate: ≈22)
π(1,000) = 168; 1000/ln(1000) ≈ 144.8 (estimate: ≈145)
π(10,000) = 1,229; 10000/ln(10000) ≈ 1,085 (estimate: ≈1085)
π(1,00,000) = 9,592; 100000/ln(100000) ≈ 8,686 (estimate: ≈8686)
π(10^6) = 78,498; 10^6/ln(10^6) ≈ 72,382
INTERPRETATION: As N grows, about 1 in every ln(N) numbers near N is prime.
Near N=1,000,000: about 1 in ln(10^6) ≈ 14 numbers is prime.
Near N=10^9: about 1 in ln(10^9) ≈ 21 numbers is prime.
Primes become RARER as numbers grow, but never disappear!
| N | Exact π(N) | N/ln(N) approx Error % | Key observation | |
|---|---|---|---|---|
| 10 | 4 | 4.3 | ≈7% | 4 primes: 2,3,5,7 |
| 100 | 25 | 21.7 | ≈13% | 25 primes known |
| 1,000 | 168 | 144.8 | ≈14% | Getting closer |
| 10,000 | 1,229 | 1,085 | ≈12% | PNT improving |
| 1,00,000 | 9,592 | 8,686 | ≈9% | ~1 in 12 near 100K |
| 10^6 | 78,498 | 72,382 | ≈‹8% | ~1 in 14 near 1M |
| 10^9 | 5,07,53,859 | 4,84,56,529 | ≈4.6% | ~1 in 21 near 1B |
13.6 Mersenne Primes and Fermat Primes
Mersenne Primes: 2^p − 1
A MERSENNE PRIME is a prime of the form M_p = 2^p − 1 where p is prime.
Named after Fr. Marin Mersenne (1588–1648), a French mathematician and theologian who studied these numbers in 1644.
KEY FACT: If 2^n − 1 is prime, then n MUST be prime.
Proof: If n = ab (composite), then 2^n−1 = (2^a−1)(2^a(b-1)+...+1), which factors.
KNOWN MERSENNE PRIMES:
M_2 = 3, M_3 = 7, M_5 = 31, M_7 = 127, M_13 = 8,191
M_17 = 131,071, M_19 = 524,287, M_31 = 2,147,483,647
...and 43 more, up to M_136,279,841 (found October 2024, 41 million digits).
NOT ALL PRIME p give Mersenne primes:
M_11 = 2^11 1 = 2,047 = 23×89 (COMPOSITE!)∢
Only 51 Mersenne primes are known (as of 2024).
CONNECTION TO PERFECT NUMBERS:
Euclid proved: If M_p is prime, then 2^(p-1) × M_p is a PERFECT NUMBER. All known perfect numbers come from Mersenne primes!
Fermat Primes: 2^(2^n) + 1
A FERMAT PRIME is a prime of the form F_n = 2^(2^n) + 1.
Named after Pierre de Fermat (1607–1665), who conjectured ALL F_n are prime.
KNOWN FERMAT PRIMES (only 5!):
F_0 = 2^1 + 1 = 3
F_1 = 2^2 + 1 = 5
F_2 = 2^4 + 1 = 17
F_3 = 2^8 + 1 = 257
F_4 = 2^16 + 1 = 65,537
FERMAT WAS WRONG: F_5 = 2^32 + 1 = 4,294,967,297 = 641 × 6,700,417. Euler discovered this in 1732. Fermat's conjecture was false!
F_5 through F_32 and beyond are all known to be COMPOSITE.
No new Fermat primes have been found for 300+ years.
CONNECTION TO GEOMETRY (Gauss):
A regular n-gon is constructible with ruler and compass if and only if
n = 2^k × (product of distinct Fermat primes).
That is why regular 17-gon and 257-gon are constructible!
13.7 Special Composite Numbers
| Type | Definition | Examples | Why Important |
|---|
Highly Composite Has more factors than 1,2,4,6,12,24,36,48,60,120, Optimal for scheduling, LCM
| any smaller positive | 180,240,360 | calculations |
integer.
| Semi-prime | Product of exactly 2 4=2²; 6=2×3; 9=3²; 10=2×5; RSA encryption uses semi- | |
| primes (need not be | 15=3×5 | primes |
distinct).
Smooth Number All prime factors are ≤ 12=2²×3 (3-smooth); 60 (5- Cryptanalysis algorithms
| some bound B (B- | smooth) | exploit smoothness |
smooth).
| Powerful Number Every prime factor 1,4,8,9,16,25,27,32,36,49,6 | N = a²×b³ for some a,b |
| appears with exponent | 4,72 |
≥2.
| Perfect Power N = a^k for integers a,k 4,8,9,16,25,27,32,36,49,64, | Squares and cubes |
| ≥2. | 81,100 |
Carmichael Composite N satisfying 561=3×11×17; 1105; 1729 Fool naive primality tests!
| Number | Fermat's Little |
Theorem.
| Pseudoprime | Composite behaving | 341=11×31 (base-2 | Important in probabilistic |
| like a prime for some | pseudoprime) | testing |
base.
13.8 Wilson’s Theorem — A Prime Characterisation
WILSON'S THEOREM:
A positive integer p > 1 is prime if and only if (p−1)! ≡ −1 (mod p).
Equivalently: (p−1)! + 1 is divisible by p.
VERIFICATION:
p=2: (2−1)! = 1! = 1. 1+1=2. 2÷2=1. (2 is prime)✓
p=3: (3−1)! = 2! = 2. 2+1=3. 3÷3=1. (3 is prime)✓
| p=5: (5 1)! = 4! = 24. 24+1=25. 25÷5=5. (5 is prime)∢ | ✓ |
| p=7: (7 1)! = 6! = 720. 720+1=721. 721÷7=103. (7 is prime)∢ | ✓ |
p=11: 10! = 36,28,800. 36,28,801 ÷ 11 = 3,29,891. (11 is prime)✓
COMPOSITE CHECK (p=4):
| (4 1)! = 3! = 6. 6+1=7. 7÷4=1 remainder 3 ≠ 0. (4 is composite) ∢ | ✗ | ✓ |
COMPOSITE CHECK (p=6):
| (6 1)! = 5! = 120. 120+1=121. 121÷6=20 remainder 1 ≠ 0. (6 composite) ∢ | ✗ | ✓ |
PRACTICAL LIMITATION: Computing (p 1)! is computationally infeasible for large p.∢
Wilson's Theorem is theoretically elegant but practically useless for primality testing!
13.9 Primes in Cryptography — Why Primes Protect Your Data
The security of most internet communications (banking, messaging, emails) relies on the fact that it is easy to MULTIPLY two large primes but extremely hard to FACTORISE the product.
THE RSA ENCRYPTION SYSTEM (simplified):
SETTING UP:
1. Choose two large prime numbers p and q (each 100+ digits).
2. Compute N = p × q (the "public modulus", a 200+ digit semi-prime).
3. Choose an encryption exponent e (public).
4. Compute a decryption exponent d (private; requires knowing p and q).
ENCRYPTION:
To send message M: compute C = M^e (mod N). Send C.
DECRYPTION:
Receiver computes M = C^d (mod N). Recovers M.
WHY IT IS SECURE:
Without knowing p and q, computing d from N and e is computationally infeasible.
The best known algorithms to factorise a 2048-bit N would take
longer than the age of the universe on all computers combined!
A SMALL EXAMPLE (with tiny primes for illustration):
p=11, q=13. N=11×13=143. e=7. d=103.
Encrypt M=5: C=5^7 mod 143 = 78,125 mod 143 = 8.
Decrypt C=8: 8^103 mod 143 = 5 = M. ✓
(Real RSA uses 2048-bit primes, not tiny 2-digit ones!)
13.10 Properties of Composite Numbers
| Property | Statement | Proof Idea | Example |
|---|---|---|---|
| Every composite has If N is composite, N has a If all factors >sqrt(N), | 100=2×50; 2<√100=10 | ||
| small factor | prime factor p≤√N. | product >N. Contradiction. | ✓ |
Density increases Composites become more PNT: primes thin out as Near 10^9: about 20 out
| common as numbers | N/ln(N). | of 21 are composite |
grow.
| Consecutive | Any 4 consecutive | At least one is even; at least 5,6,7,8: 6=2×3, 8=2³ | |
| composites | integers ≥5 always | one has factor 3 or 5. | composite |
includes a composite.
| Long runs of | For any n, exists n | Proof: (n+1)!+2,...,(n+1)!+ | 5!=120: |
| composites | consecutive composites. | (n+1). | 122,123,124,125,126 all |
composite
| Composite | N composite ⇔ N divides Wilson's theorem converse. | 6|5!=120 ✓ | |
| characterisation | (N 1)! (for N>4).∢ | ||
| Goldbach | Every even N>2 = p+q Verified up to 4×10^18 by 100=3+97=11+89=17+8 | ||
| decomposition | for primes p,q | computer. | 3=... |
(unproven).
WORKED EXAMPLES
Section A: Easy Problems — Foundation Level (Classes 5–6)
Problem 1: Determine whether each number is prime using the 6k±1 rule and trial division: (a) 127 (b) 221 (c) 257 (d) 391 (e) 673
✔ Solution
(a) 127:
127 = 6×21+1 = 126+1. Form 6k+1 (could be prime).✓
√127≈11.3. Test primes 2,3,5,7,11:
127 is odd; digit sum=10 (not ÷3); doesn't end in 0/5; 127÷7=18.1; 127÷11=11.5.
| PRIME. (It is a Mersenne prime: 2^7 1=127!)✓ | ∢ |
(b) 221:
221 = 6×36+5 = 216+5. Form 6k+5=6k−1. Could be prime.
√221≈14.9. Test: 2(odd), 3(2+2+1=5), 5(no), 7(221÷7=31.6), 11(221÷11=20.1), 13(221÷13=17
✓!).
221 = 13 × 17. COMPOSITE.
(c) 257:
257 = 6×42+5. Form 6k+5. Could be prime.
√257≈16.0. Test: 2,3,5,7,11,13: none divide 257.
257÷7=36.7; 257÷11=23.4; 257÷13=19.8; 257÷17=15.1. None exact.
PRIME. (It is a Fermat prime: 2^(2^3)+1=257!)✓
(d) 391:
391 = 6×65+1. Form 6k+1. Could be prime.
√391≈19.8. Test: 2,3,5,7,11,13,17,19.
391÷17=23 ! 391 = 17 × 23. COMPOSITE.✓
(e) 673:
673 = 6×112+1. Form 6k+1. Could be prime.
√673≈25.9. Test all primes up to 25: 2,3,5,7,11,13,17,19,23.
673÷7=96.1; ÷11=61.2; ÷13=51.8; ÷17=39.6; ÷19=35.4; ÷23=29.3. None exact.
PRIME. ✓
ANSWERS: (a) Prime (Mersenne!) (b) Composite: 13×17 (c) Prime (Fermat!)
(d) Composite: 17×23 (e) Prime
Problem 2: Identify which of the following are twin primes, cousin primes, or sexy primes: (a) (101, 103) (b) (103, 107) (c) (107, 113) (d) (149, 151)
✔ Solution
First verify which are prime:
101: √101≈10.0. Test 2,3,5,7: 101÷7=14.4. PRIME.
103: Test 2,3,5,7: 103÷7=14.7. PRIME.
107: Test 2,3,5,7: 107÷7=15.3. PRIME.
113: Test up to 10: 113÷7=16.1; ÷11=10.3. PRIME.
149: Test up to 12: 149÷7=21.3; ÷11=13.5. PRIME.
151: Test up to 12: 151÷7=21.6; ÷11=13.7. PRIME.
All six numbers are prime. Now classify the pairs:
(a) (101, 103): Difference = 103−101 = 2. TWIN PRIMES! ✓
(b) (103, 107): Difference = 107−103 = 4. COUSIN PRIMES! ✓
(c) (107, 113): Difference = 113−107 = 6. SEXY PRIMES! ✓
(Named "sexy" from Latin "sex" = six)
(d) (149, 151): Difference = 151−149 = 2. TWIN PRIMES! ✓
Beautiful: Three consecutive prime pairs (101,103), (103,107), (107,113)
illustrate all three prime-pair types! 101, 103, 107, 113 form a tight prime cluster.
ANSWERS: (a) Twin (b) Cousin (c) Sexy (d) Twin
Problem 3: Verify Wilson's Theorem for p=5, p=7, and p=11. Then check that it fails for n=4 (composite).
✔ Solution
Wilson's Theorem: p prime ⇔ (p 1)! ≡ −1 (mod p)∢
p = 5:
(5 1)! = 4! = 24.∢
24 mod 5 = 24 − 4×5 = 24−20 = 4 ≡ −1 (mod 5). [since −1 ≡ 4 (mod 5)] ✓
p = 7:
(7 1)! = 6! = 720.∢
720 mod 7: 720 = 7×102 + 6. Remainder = 6 ≡ −1 (mod 7). [since −1 ≡ 6 (mod 7)] ✓
p = 11:
(11 1)! = 10! = 36,28,800.∢
36,28,800 mod 11: digit alternating sum check:
36,28,800 ÷ 11: 11×3,29,890 = 36,28,790. Remainder = 10 ≡ −1 (mod 11). ✓
| So 10! ≡ 1 (mod 11). ∢ | ✓ |
COMPOSITE CHECK n = 4:
(4 1)! = 3! = 6.∢
6 mod 4 = 2 ≠ 1 ≡ 3 (mod 4).∢
| 2 ≠ 3. Wilson’s condition FAILS. Confirming 4 is composite. ✗ | ✓ |
ANSWERS: Wilson's Theorem confirmed for p=5 (4!≡4), p=7 (6!≡6), p=11 (10!≡10).
Fails for n=4 (3!≢2≠3). Theorem is both necessary and sufficient!
Problem 4: Show that there are at least 5 consecutive composite numbers between 113 and 127. Then construct 8 consecutive composites using the factorial method.
✔ Solution
BETWEEN 113 AND 127:
113 is prime; 127 is prime.
Numbers between: 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126.
That is 13 consecutive composite numbers!
114 = 2×57; 115 = 5×23; 116 = 4×29; 117 = 9×13; 118 = 2×59;
119 = 7×17; 120 = 2³×3×5; 121 = 11²; 122 = 2×61; 123 = 3×41;
124 = 4×31; 125 = 5³; 126 = 2×63.
All 13 are composite. ✓
CONSTRUCTING 8 CONSECUTIVE COMPOSITES using factorial method:
The numbers 9!+2, 9!+3, 9!+4, 9!+5, 9!+6, 9!+7, 9!+8, 9!+9
are all composite (9! = 3,62,880):
3,62,882 = 2 × (9!/2 + 1): divisible by 2. Composite.
3,62,883: digit sum = 3+6+2+8+8+3=30; divisible by 3. Composite.
3,62,884: even. Composite.
3,62,885: ends in 5. Composite.
3,62,886: even. Composite.
3,62,887: 9!+7. 7 divides 9! (since 7≤9). 7 divides 3,62,887. Composite.
3,62,888: even. Composite.
3,62,889: digit sum 39; divisible by 3. Composite.
All 8 numbers 3,62,882 through 3,62,889 are composite! ✓
ANSWER: 13 composites between 113 and 127.
8 consecutive composites starting at 9!+2 = 3,62,882.
Problem 5: A cicada species emerges every 13 years; another every 17 years. Both emerged in
2023. In what year will they both emerge together again? Why are 13 and 17 evolutionarily advantageous prime numbers for cicadas?
✔ Solution
The cicadas will emerge together when both 13-year and 17-year cycles coincide.
Next joint emergence: 2023 + LCM(13, 17).
LCM(13, 17):
13 and 17 are both prime, so gcd(13,17) = 1.
LCM(13,17) = 13×17 = 221.
Next joint emergence: 2023 + 221 = 2244.
WHY PRIME CYCLE LENGTHS ARE ADVANTAGEOUS:
Predators that synchronize their cycles with the cicadas would also need
to wait LCM(predator period, cicada period) years to find cicadas.
If cicada period = 13 (prime):
Predator with 2-year cycle: waits 13×2/gcd(13,2) = 26 years.
Predator with 3-year cycle: waits 39 years.
Predator with 4-year cycle: waits 52 years.
Predator with 6-year cycle: waits 78 years.
If cicada period = 12 (composite):
Predator with 2-year cycle: waits LCM(12,2)=12 years (much less!).
Predator with 3-year cycle: waits LCM(12,3)=12 years.
Predator with 4-year cycle: waits LCM(12,4)=12 years.
Many predators stay synchronized. Bad for cicadas!
Prime periods MAXIMIZE the wait for predators — an evolutionary advantage.
The 13-year and 17-year cicadas (Magicicada) are famous examples.
ANSWER: Next joint emergence in 2244 (221 years later).
Prime periods protect against predator synchronization.
Problem 6: Find all two-digit emirp primes (primes whose digit-reversal is a DIFFERENT prime). List them all.
✔ Solution
EMIRP = prime whose reversal is a different prime (not a palindrome).
(The word "emirp" = "prime" spelled backwards!)
Strategy: List all 2-digit primes, then check if their reversal is a different prime.
2-digit primes: 11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97.
Palindromes (same forward/backward): 11. NOT emirp.
Check each non-palindrome prime:
13 → 31 (prime!) Emirp pair: (13,31)✓
17 → 71 (prime!) Emirp pair: (17,71)✓
19 → 91 = 7×13. Not prime. Not emirp.
23 → 32 = 2^5. Not prime. Not emirp.
29 → 92 = 4×23. Not prime. Not emirp.
31 → 13 (prime!) Already noted.✓
37 → 73 (prime!) Emirp pair: (37,73)✓
41 → 14 = 2×7. Not prime. Not emirp.
43 → 34 = 2×17. Not prime. Not emirp.
47 → 74 = 2×37. Not prime. Not emirp.
53 → 35 = 5×7. Not prime. Not emirp.
59 → 95 = 5×19. Not prime. Not emirp.
61 → 16 = 2^4. Not prime. Not emirp.
67 → 76 = 4×19. Not prime. Not emirp.
71 → 17 (prime!) Already noted.✓
73 → 37 (prime!) Already noted.✓
79 → 97 (prime!) Emirp pair: (79,97)✓
83 → 38 = 2×19. Not prime. Not emirp.
89 → 98 = 2×49. Not prime. Not emirp.
97 → 79 (prime!) Already noted.✓
ALL 2-DIGIT EMIRP PAIRS: (13,31), (17,71), (37,73), (79,97).
That is 8 two-digit emirp primes total: 13, 17, 31, 37, 71, 73, 79, 97.
Section B: Medium Problems — CBSE/NCERT Standard (Classes 6–8)
Problem 7: Prove: If p is a prime > 3, then p^2 ≡ 1 (mod 24). Verify for p = 5, 7, 11, 13.
✔ Solution
CLAIM: For any prime p > 3: p^2 ≡ 1 (mod 24).
PROOF:
Since p > 3, p is not divisible by 2 or 3.
So p ≡ 1 or 5 (mod 6) [from the 6k±1 rule].
Case 1: p ≡ 1 (mod 6). Then p = 6k+1 for some integer k.
p^2 = (6k+1)^2 = 36k^2+12k+1 = 12k(3k+1)+1.
Since either k or 3k+1 is even: 12k(3k+1) is divisible by 24.
So p^2 ≡ 1 (mod 24). ✓
Case 2: p ≡ 5 (mod 6). Then p = 6k+5 for some k≥0.
p^2 = (6k+5)^2 = 36k^2+60k+25 = 36k^2+60k+24+1 = 12(3k^2+5k+2)+1.
3k^2+5k+2 = (3k+2)(k+1). Among k and k+1: one is even.
So 12(3k+2)(k+1) is divisible by 24.
So p^2 ≡ 1 (mod 24). ✓
In both cases, p^2 ≡ 1 (mod 24). QED.
VERIFICATION:
p=5: p^2=25. 25−24=1 ≡ 1 (mod 24). ✓
p=7: p^2=49. 49−48=1 ≡ 1 (mod 24). ✓
p=11: p^2=121. 121−120=1 ≡ 1 (mod 24). ✓
p=13: p^2=169. 169−168=1 ≡ 1 (mod 24). ✓
BEAUTIFUL: For ANY prime p > 3, p^2 always leaves remainder 1 when divided by 24!
Problem 8: The "Ulam Spiral" arranges integers in a spiral and marks primes. It reveals that primes cluster along diagonal lines. Investigate why numbers of the form n^2 + n + 41 tend to be prime for n = 0, 1, 2, ..., 39. Verify for n = 0, 1, 5, 10, 20 and find the first n where it fails.
✔ Solution
EULER'S PRIME-GENERATING POLYNOMIAL: f(n) = n^2 + n + 41
Verify for specific n:
n=0: f(0) = 0+0+41 = 41. PRIME. ✓
n=1: f(1) = 1+1+41 = 43. PRIME. ✓
n=5: f(5) = 25+5+41 = 71. PRIME. ✓
n=10: f(10) = 100+10+41 = 151. PRIME. ✓
n=20: f(20) = 400+20+41 = 461. PRIME. ✓
n=39: f(39) = 1521+39+41 = 1601. PRIME. ✓
FIRST FAILURE:
n=40: f(40) = 1600+40+41 = 1681 = 41^2. COMPOSITE! ✗
WHY DOES IT FAIL AT n=40?
f(40) = 40^2 + 40 + 41 = 40(40+1) + 41 = 40×41 + 41 = 41(40+1) = 41×41 = 41^2.
Of course 41^2 is not prime!
In fact: f(n) = n^2+n+41. When n = 41k−41 = 41(k 1):∢
f(41k−41) would be divisible by 41.
And specifically, n=40 gives f(40)=41^2.
WHY THE FORMULA WORKS FOR n=0 TO 39:
No rigorous simple explanation. The number 41 is prime, and certain prime values
of the constant in n^2+n+p produce "prime-rich" polynomials.
Euler discovered this in 1772. Similar: n^2+n+17 works for n=0,...,15.
BOTTOM LINE: No polynomial can produce ONLY primes for all integer inputs.
(Proof: if f(n_0)=p for some n_0, then f(n_0+p)=f(n_0+p)≡f(n_0)≡0 mod p.)
ANSWER: Formula works for n=0 to 39 (40 consecutive primes!). Fails at n=40: 1681=41^2.
Problem 9: Prove: If p and q are distinct primes with p < q, then pq (their product) always has exactly 4 factors. How many factors does pq have if p = q? What about p^2×q?
✔ Solution
CASE 1: p ≠ q (distinct primes).
N = p×q = p^1 × q^1.
Number of factors = (1+1)(1+1) = 2×2 = 4.
The four factors are: {1, p, q, pq}.
| PROOF: Any factor of pq must be of the form p^a×q^b where a {0,1} and b {0,1}.∈ | ∈ |
This gives 4 combinations: (a,b)=(0,0),(1,0),(0,1),(1,1) → 1,p,q,pq. QED.
CASE 2: p = q (same prime).
N = p×p = p^2.
Number of factors = (2+1) = 3.
The three factors are: {1, p, p^2}.
Example: 4 = 2^2. Factors: {1, 2, 4}. 3 factors. ✓
CASE 3: N = p^2 × q (p ≠ q, distinct primes).
Number of factors = (2+1)(1+1) = 3×2 = 6.
The six factors: {1, p, p^2, q, pq, p^2q}.
Example: N = 2^2×3 = 12. Factors: {1,2,3,4,6,12}. 6 factors. ✓
SUMMARY:
pq (distinct): 4 factors.
p^2 (same): 3 factors.
p^2×q (distinct): 6 factors.
GENERALISATION: For N = p^a×q^b: factors = (a+1)(b+1).
Problem 10: Using the Prime Number Theorem, estimate: (a) How many primes are there between 10,000 and 20,000? (b) About what fraction of 6-digit numbers are prime? (c) If you pick a random 10-digit number, what is the probability it is prime?
✔ Solution
(a) Primes between 10,000 and 20,000:
π(20,000) ≈ 20,000/ln(20,000) = 20,000/9.903 ≈ 2,020.
π(10,000) ≈ 10,000/ln(10,000) = 10,000/9.210 ≈ 1,086.
Estimated count = 2,020 − 1,086 = 934.
Exact count: π(20,000) = 2,262; π(10,000) = 1,229. Exact: 1,033.
Our estimate 934 is within 10% of exact. ✓
(b) Fraction of 6-digit numbers that are prime:
6-digit numbers range from 100,000 to 999,999.
Use the PNT approximation: near N=500,000 (midpoint), probability ≈ 1/ln(500,000). ln(500,000) ≈ 13.12.
Fraction ≈ 1/13 ≈ 7.7%.
More precisely: π(999,999)≈ 78,498; π(99,999)≈9,592;
6-digit primes ≈ 78,498−9,592 = 68,906.
Total 6-digit numbers = 900,000.
Exact fraction = 68,906/900,000 ≈ 7.66%. Very close to our estimate! ✓
(c) Probability a random 10-digit number is prime:
Near N = 5×10^9 (midpoint of 10-digit range):
Probability ≈ 1/ln(5×10^9) = 1/ln(5×10^9).
ln(5×10^9) = ln(5) + 9×ln(10) = 1.609 + 9×2.303 = 1.609+20.727 = 22.34.
Probability ≈ 1/22.34 ≈ 4.5%.
About 1 in 22 random 10-digit numbers is prime.
ANSWERS:
(a) About 934 primes between 10,000 and 20,000 (exact: 1,033).
(b) About 7.7% of 6-digit numbers are prime.
(c) About 4.5% chance — roughly 1 in 22.
Problem 11: Identify all Carmichael numbers up to 2000. A Carmichael number is a composite number N satisfying a^N ≡ a (mod N) for ALL integers a. The smallest is 561. Verify that 561 is Carmichael.
✔ Solution
CARMICHAEL NUMBERS up to 2000: 561, 1105, 1729.
(The next ones are 2465, 2821, ... all above 2000.)
VERIFY 561 IS CARMICHAEL:
Step 1: Show 561 is composite.
561 = 3 × 11 × 17. Composite. ✓
Step 2: Check Korselt's Criterion (easier than testing all a):
N is Carmichael if: N is squarefree AND for every prime factor p of N, (p 1)|(N 1).∢ ∢
561 = 3×11×17. Squarefree (no prime repeated). ✓
N 1 = 560.∢
| Check (3 1)=2 divides 560: 560/2=280. ∢ | ✓ |
| Check (11 1)=10 divides 560: 560/10=56. ∢ | ✓ |
| Check (17 1)=16 divides 560: 560/16=35. ∢ | ✓ |
All conditions satisfied. 561 is Carmichael. ✓
Step 3: Verify for a specific base (a=2):
Need: 2^561 ≡ 2 (mod 561). This means 2^560 ≡ 1 (mod 561).
Using Fermat's theorem on each factor:
2^560 mod 3: 2^2≡1(mod 3); 560=2×280; 2^560=(2^2)^280≡1 (mod 3). ✓
2^560 mod 11: 2^10≡1(mod 11); 560=10×56; 2^560=(2^10)^56≡1 (mod 11). ✓
2^560 mod 17: 2^16≡1(mod 17); 560=16×35; 2^560=(2^16)^35≡1 (mod 17). ✓
By CRT: 2^560≡1 (mod 3×11×17=561). So 2^561≡2 (mod 561). ✓
Carmichael numbers fool the Fermat primality test: they look prime for all bases a.
They are called "absolute pseudoprimes".
ANSWERS: Carmichael numbers up to 2000: 561, 1105, 1729.
561 = 3×11×17 verified via Korselt's Criterion.
Problem 12: Sophie Germain primes: p such that 2p+1 is also prime. Find all Sophie Germain primes up to 100. What is the associated "safe prime" for each?
✔ Solution
SOPHIE GERMAIN PRIME: p is prime AND 2p+1 is also prime.
The prime 2p+1 is called the SAFE PRIME associated with p.
Test each prime p up to 100:
p=2: 2p+1=5. Prime. Safe prime: 5.✓
p=3: 2p+1=7. Prime. Safe prime: 7.✓
p=5: 2p+1=11. Prime. Safe prime: 11.✓
p=7: 2p+1=15=3×5. Not prime. ✗
p=11: 2p+1=23. Prime. Safe prime: 23.✓
p=13: 2p+1=27=3^3. Not prime. ✗
p=17: 2p+1=35=5×7. Not prime. ✗
p=19: 2p+1=39=3×13. Not prime. ✗
p=23: 2p+1=47. Prime. Safe prime: 47.✓
p=29: 2p+1=59. Prime. Safe prime: 59.✓
p=31: 2p+1=63=9×7. Not prime. ✗
p=37: 2p+1=75=3×25. Not prime. ✗
p=41: 2p+1=83. Prime. Safe prime: 83.✓
p=43: 2p+1=87=3×29. Not prime. ✗
p=47: 2p+1=95=5×19. Not prime. ✗
p=53: 2p+1=107. Prime. Safe prime: 107.✓
p=59: 2p+1=119=7×17. Not prime. ✗
p=61: 2p+1=123=3×41. Not prime. ✗
p=67: 2p+1=135=5×27. Not prime. ✗
p=71: 2p+1=143=11×13. Not prime. ✗
p=73: 2p+1=147=3×49. Not prime. ✗
p=79: 2p+1=159=3×53. Not prime. ✗
p=83: 2p+1=167. Prime. Safe prime: 167.✓
p=89: 2p+1=179. Prime. Safe prime: 179.✓
p=97: 2p+1=195=3×65. Not prime. ✗
SOPHIE GERMAIN PRIMES up to 100:
2, 3, 5, 11, 23, 29, 41, 53, 83, 89
Associated SAFE PRIMES:
5, 7, 11, 23, 47, 59, 83, 107, 167, 179
WHY SAFE PRIMES MATTER: Safe primes are used in Diffie-Hellman key exchange (the protocol that secures internet banking). The size of the safe prime determines the security level.
ANSWER: 10 Sophie Germain primes up to 100: {2,3,5,11,23,29,41,53,83,89}.
Section C: Hard / Challenge Problems — ICSE & Olympiad Level
Challenge Problem 13: Prove: For any prime p ≥ 5, p^4 ≡ 1 (mod 120). Note: 120 = 8 × 3 × 5.
✔ Solution
Need to show: p^4 ≡ 1 (mod 8), p^4 ≡ 1 (mod 3), and p^4 ≡ 1 (mod 5).
MOD 8:
p is prime ≥5. So p is odd. Write p=2m+1.
p^2 = (2m+1)^2 = 4m^2+4m+1 = 4m(m+1)+1.
Since m(m+1) is always even: 4m(m+1) is divisible by 8.
So p^2 ≡ 1 (mod 8).
Therefore p^4 = (p^2)^2 ≡ 1^2 = 1 (mod 8). ✓
MOD 3:
p is prime ≥5, so p is not divisible by 3.
By Fermat's Little Theorem: p^2 ≡ 1 (mod 3) [since p^{3-1}=p^2≡1 mod 3].
Therefore p^4 = (p^2)^2 ≡ 1^2 = 1 (mod 3). ✓
MOD 5:
p is prime ≥5, so p≠5 and p is not divisible by 5.
By Fermat's Little Theorem: p^{5-1} = p^4 ≡ 1 (mod 5). ✓
(This is exactly the theorem for the prime modulus 5!)
COMBINING (since 8, 3, 5 are pairwise coprime):
p^4 ≡ 1 (mod 8), (mod 3), (mod 5) implies p^4 ≡ 1 (mod 8×3×5=120).
By the Chinese Remainder Theorem. QED.
VERIFICATION:
p=7: p^4=2401. 2401÷120=20 remainder 1. 2401=120×20+1. ✓
p=11: p^4=14641. 14641÷120=122 remainder 1. 14641=120×122+1. ✓
p=13: p^4=28561. 28561÷120=238 remainder 1. 28561=120×238+1. ✓
ANSWER: p^4≡1(mod 120) for all primes p≥5. Proven using Fermat's Little Theorem.
Challenge Problem 14: Prove: Between consecutive perfect squares n^2 and (n+1)^2, the count of numbers is 2n. Among these 2n numbers, how many are prime on average (using the PNT)? Use this to estimate the number of primes between 10^6 and (10^3+1)^2 = 1,002,001.
✔ Solution
PART 1: Numbers between n^2 and (n+1)^2.
Numbers strictly between n^2 and (n+1)^2: n^2+1, n^2+2, ..., (n+1)^2-1.
Count = (n+1)^2 - 1 - n^2 = n^2+2n+1-1-n^2 = 2n.
So there are exactly 2n integers strictly between n^2 and (n+1)^2. QED.
PART 2: Average prime count using PNT.
The density of primes near N is approximately 1/ln(N).
Near N = n^2, density ≈ 1/ln(n^2) = 1/(2ln n).
Expected primes in the interval of 2n numbers:
Expected count ≈ 2n / (2ln n) = n / ln(n).
PART 3: Primes between 10^6 and (10^3+1)^2 = 1,002,001.
Here n = 10^3 = 1000.
The interval: from (1000)^2 = 10^6 to (1001)^2 = 1,002,001.
Number of integers in this interval = (1001)^2 - 10^6 - 1 = 1,002,001-10^6-1 = 2,000.
(Matching 2n = 2×1000 = 2000 )✓
Density near 10^6: 1/ln(10^6) = 1/(6×ln 10) = 1/(6×2.3026) = 1/13.816 ≈ 0.0724.
Expected primes in 2000 numbers: 2000 × 0.0724 ≈ 144.8 ≈ 145.
Exact check: π(1,002,001)−π(1,000,000) can be computed.
π(10^6) = 78,498. The density approach gives ≈70–145 primes in this gap.
More accurate estimate: n/ln(n) = 1000/ln(1000) = 1000/6.908 ≈ 144.8. ✓
ANSWER:
2n=2000 integers between 10^6 and (10^3+1)^2.
Expected primes ≈ n/ln(n) = 1000/ln(1000) ≈ 145.
Challenge Problem 15: Find all primes p < 1,000 such that p, p+2, p+6, p+8 are ALL prime (prime quadruplets). Search all p < 1,000, and prove that apart from p = 5, every such p leaves remainder 1 when divided by 5.
✔ Solution
PRIME QUADRUPLET: p, p + 2, p + 6, p + 8 all prime.
Look at the remainders when divided by 5:
p ≡ 2 (mod 5) → p + 8 ≡ 0, so p + 8 is a multiple of 5 (and bigger than 5): not prime.
p ≡ 3 (mod 5) → p + 2 ≡ 0: not prime unless p + 2 = 5, i.e. p = 3, but then p + 6 = 9 is not prime. p ≡ 4 (mod 5) → p + 6 ≡ 0: not prime.
p ≡ 0 (mod 5) → p itself is a multiple of 5, so p = 5: (5, 7, 11, 13) ✓
p ≡ 1 (mod 5) → none of the four is a multiple of 5, so a quadruplet is possible.
So apart from p = 5, every starting prime leaves remainder 1 on division by 5.
Searching p < 1,000: (5, 7, 11, 13), (11, 13, 17, 19), (101, 103, 107, 109), (191, 193, 197, 199), (821, 823, 827, 829).
ANSWER: p = 5, 11, 101, 191, 821.
Challenge Problem 16: Prove: The product of any k consecutive integers is divisible by k!. As a consequence, show that C(n,k) = n! / (k!(n-k)!) is always an integer.
✔ Solution
CLAIM: The product of any k consecutive integers is divisible by k!.
PROOF:
Let the k consecutive integers be n, n+1, n+2, ..., n+k-1.
Their product = n(n+1)(n+2)...(n+k-1).
This product equals: n(n+1)...(n+k-1) = (n+k-1)! / (n-1)!
[Dividing the factorial of (n+k-1) by all terms below n]
Now: C(n+k-1, k) = (n+k-1)! / (k! (n-1)!) = [n(n+1)...(n+k-1)] / k!
Since C(n+k-1, k) is a binomial coefficient, it is ALWAYS an integer
(it counts the number of ways to choose k items from n+k-1).
Therefore: n(n+1)...(n+k-1) / k! = C(n+k-1, k) is an integer.
This means k! divides n(n+1)...(n+k-1). QED.
CONSEQUENCE: C(n,k) is always an integer.
C(n,k) = n(n-1)(n-2)...(n-k+1) / k!
= (product of k consecutive integers starting from n-k+1 to n) / k!.
This is k consecutive integers divided by k!, which we just proved is always an integer.
So C(n,k) is always a whole number. QED.
NUMERICAL EXAMPLES:
Product of 4 consecutive: 5×6×7×8 = 1,680. 1680/4! = 1680/24 = 70 = C(8,4). ✓
Product of 3 consecutive: 10×11×12 = 1,320. 1320/6 = 220 = C(12,3). ✓
SIGNIFICANCE: This theorem explains why binomial coefficients are always integers,
which is used in Pascal's triangle, probability, and combinatorics throughout mathematics.
OLYMPIAD CORNER
Competition-level problems for IMO, SOF-IMO, IAIS, and National Mathematics Olympiad.
Olympiad Problem O-1: Prove that for every prime p > 3, exactly one of p−2, p, p+2 is divisible by 3. Hence deduce that among any three consecutive odd numbers, at most one can be prime (for numbers > 3). Find all sets of three consecutive odd primes.
✔ Solution
PART 1: p − 2, p, p + 2 leave three different remainders on division by 3 (their differences are 2 and 4, neither a multiple of 3), so exactly one of them is a multiple of 3. For a prime p > 3, that one is p − 2 or p + 2.
PART 2: Three consecutive odd numbers m, m + 2, m + 4 also leave three different remainders on
division by 3, so exactly one is a multiple of 3.
If all three are prime, that multiple of 3 must be 3 itself. The only possibility is m = 3: (3, 5, 7). For m > 3 at least one of the three is composite, so at most two are prime.
ANSWER: The only three consecutive odd primes are 3, 5, 7.
Olympiad Problem O-2: The power tower 2^2^2^2 (four 2s) is evaluated from the top
down. Find its value, decide whether it is prime or composite, and give one factor.
✔ Solution
A power tower is evaluated from the TOP down:
2^2 = 4; then 2^4 = 16; then 2^16 = 65,536.
So 2^2^2^2 = 65,536 = 2¹⁶.
It is an even number greater than 2, so it is COMPOSITE; one factor is 2.
(A tower of FIVE 2s is 2^65,536, a number with about 19,729 digits — also composite, with factor 2.)
ANSWER: 65,536 — composite (factor 2).
Olympiad Problem O-3: Bertrand's Postulate states: For every integer n > 1, there is always at least one prime p with n < p ≤ 2n. Verify for n = 10, 20, 50. Then use it to prove there are at least k distinct primes up to 2^k.
✔ Solution
BERTRAND'S POSTULATE (proved by Chebyshev in 1852):
For every n > 1, there exists a prime p with n < p ≤ 2n.
VERIFICATION:
n=10: Need prime in (10,20]. Primes: 11,13,17,19. YES! ✓
n=20: Need prime in (20,40]. Primes: 23,29,31,37. YES! ✓
n=50: Need prime in (50,100]. Primes: 53,59,61,67,71,73,79,83,89,97. YES! ✓
USING BERTRAND'S POSTULATE TO PROVE ≥ k primes up to 2^k:
PROOF by induction on k:
Base case k=1: 2^1=2. There is at least 1 prime ≤2, namely {2}. ✓
Inductive step: Assume there are at least k distinct primes up to 2^k.
We want to show at least k+1 primes up to 2^{k+1}.
By Bertrand's Postulate applied to n=2^k:
There exists a prime p with 2^k < p ≤ 2^{k+1}.
This prime p is NEW (it's greater than 2^k, so not among the k primes up to 2^k).
By inductive hypothesis: ≥k primes up to 2^k.
Plus the new prime p in (2^k, 2^{k+1}].
Total: at least k+1 distinct primes up to 2^{k+1}. QED.
EXPLICIT VERIFICATION:
k=1: 2^1=2. Primes ≤2: {2}. At least 1 prime. ✓
k=2: 2^2=4. Primes ≤4: {2,3}. At least 2 primes. ✓
k=3: 2^3=8. Primes ≤8: {2,3,5,7}. At least 3 primes (actually 4). ✓
k=4: 2^4=16. Primes ≤16: {2,3,5,7,11,13}. At least 4 (actually 6). ✓
k=5: 2^5=32. Primes ≤32: {2,3,5,7,11,13,17,19,23,29,31}. At least 5 (actually 11). ✓
ANSWER: Bertrand's Postulate verified for n=10,20,50.
Proof by induction: ≥k primes up to 2^k (using postulate at each step).
BRAIN TEASERS
Brain Teaser 1
Can the sum of two prime numbers ever be prime? When can this happen, and when can it not? Prove your answer.
Answer: The sum of two primes is prime only when one of the primes is 2. Proof: Every prime > 2 is odd. Sum of two odd primes = even = at least 4 = composite. Sum of 2 (even prime) + odd prime = odd = might be prime. Examples: 2+3=5 (prime), 2+5=7 (prime), 2+11=13 (prime). Counter-examples: 3+5=8 (composite), 7+11=18 (composite). Conclusion: p+q is prime only if min(p,q)=2.
Brain Teaser 2
The year 2027 — is it prime? What about 2029, 2030, 2031, 2033? Which years from 2025 to
2035 are prime?
Answer: 2027: digit sum=11, not ÷3; odd; not÷5; 2027÷7=289.6; ÷11=184.3; ÷13=155.9; ÷17=119.2; ÷19=106.7; ÷23=88.1; ÷29=69.9; ÷31=65.4; ÷37=54.8; ÷41=49.4; ÷43=47.1; √2027≈45. Not divisible by any prime up to 45. PRIME! 2029: 2+0+2+9=13; 2029÷7=289.9; ÷11=184.5; ÷13=156.1; ÷17=119.4; ÷19=106.8; ÷23=88.2; ÷29=69.9; ÷31=65.5; ÷37=54.8; ÷41=49.5; ÷43=47.2. PRIME! 2030=2×5×203. COMPOSITE. 2031=3×677. COMPOSITE. 2033=prime? 2033÷7=290.4; ÷11=184.8; ÷13=156.4; ÷17=119.6; ÷19=107.0; 19×107=2033! 2033=19×107. COMPOSITE. Primes from 2025 to 2035: 2027, 2029 (and checking all: 2025=45^2, 2026=2×1013, 2027=prime, 2028=4×507, 2029=prime,
2030=composite, 2031=3×677, 2032=composite, 2033=19×107, 2034=2×1017, 2035=5×11×37). Only 2027 and 2029 are prime in this range.
Brain Teaser 3
Magic prime: The number 73 is a prime. Reversed it is 37, also prime. Their product
73×37=2701. Does 2701 have a factor that is also a prime formed by the digits of 73 reversed? Investigate.
Answer: 73 is prime; 37 is prime (emirp pair!). 73×37=2701. Factors of 2701: 2701÷37=73. So
2701=37×73. The only prime factors of 2701 are 37 and 73 themselves! This is trivially true since 2701=37×73 is a semi-prime. The "factors that are primes formed by reversed digits" are exactly 37 and 73, the original emirps. So the circle is closed: 2701=37×73, and each factor is the reversal of the other. 73 reversed=37, and 37 reversed=73. Both prime.
Brain Teaser 4
If you add all digits of a prime number and keep adding until a single digit remains (the digital
root), can the result be 3, 6, or 9? Prove your answer.
Answer: The digital root equals N mod 9 (with 9 instead of 0). If digital root = 3: N≡3(mod 9), so N is divisible by 3 and N>3, hence composite. If digital root = 6: N≡6(mod 9), divisible by 3 (since 6=2×3), composite. If digital root = 9: N≡0(mod 9), divisible by 9, composite (unless N=9, not prime). So for any prime p>3: digital root of p CANNOT be 3, 6, or 9. (For p=3: digital root=3; for p=2: digital root=2.) Conclusion: primes > 3 have digital roots in {1,2,4,5,7,8}.
Brain Teaser 5
The "repunit" number R_n = 111...1 (n ones). For what values of n can R_n be prime? Check
n=2, 3, 4, 5, 6 and explain why n must be prime for R_n to be prime.
Answer: R_n = (10^n-1)/9. R_2=11 (prime!). R_3=111=3×37 (composite). R_4=1111=11×101
(composite). R_5=11111=41×271 (composite). R_6=111111=3×7×11×13×37 (composite). The rule: If n is composite, n=ab, then R_n = R_a × (10^a(b-1)+...+10^a+1) is composite. So n must be prime for R_n to even possibly be prime. But even with prime n, R_n is usually composite! Known prime repunits (called repunit primes): n=2 (R_2=11), n=19, n=23, n=317, n=1031. None for n=3,5,7,11,13,17. Very rare!
SOPHIE GERMAIN (1776–1831) was a French mathematician who, to be taken seriously in a
male-dominated field, initially corresponded as "M. LeBlanc". Gauss, upon learning her
true identity, said she must have "the most noble courage and superior genius".
CICADAS and prime number theory: The 13-year and 17-year cicada species (Magicicada)
use prime-length life cycles to minimize encounters with predators and avoid
synchronizing with shorter-cycle parasites. Evolution discovered number theory!
THE RIEMANN HYPOTHESIS (1859, still unproven): All non-trivial zeros of the
Riemann zeta function lie on the "critical line" Re(s) = 1/2.
This would give a precise formula for the distribution of primes.
It is considered the most important unsolved problem in mathematics.
There is a $1,000,000 prize for a proof.
LARGEST KNOWN PRIME (2024): 2^136,279,841 − 1 (a Mersenne prime).
Found by GIMPS (Great Internet Mersenne Prime Search) on October 12, 2024.
It has 41,024,320 digits. Written at 10 digits per second, it would take 47 days!
AKS PRIMALITY TEST (2002): Three Indian computer scientists (Agrawal, Kayal, Saxena)
from IIT Kanpur proved that primality can be tested in polynomial time.
This was a major breakthrough in computational number theory!
PRACTICE EXERCISE 13.A — Easy (Classes 5–6)
Show all primality testing steps. State which method you used for each.
1. Test for primality using trial division: (a) 191 (b) 289 (c) 361 (d) 401 (e) 503
2. Apply the 6k±1 rule to quickly eliminate: (a) 201 (b) 203 (c) 299 (d) 301 (e) 323
3. Find all prime numbers between: (a) 200 and 250 (b) 500 and 550 (c) 900 and 950
4. Identify the prime family for each pair: (a)(197,199) (b)(193,197) (c)(191,197) (d)(149,151)
5. Find all circular primes up to 200. (A number where ALL digit rotations are prime.)
6. List all Sophie Germain primes between 100 and 200.
7. Verify Wilson's Theorem for p=13 and p=17. Confirm it fails for n=8.
8. Find all emirp primes with 3 digits where the number is also an emirp. (3-digit emirps)
9. Is 2023 prime? 2024? 2025? 2026? Find the nearest prime to each of these years.
10. The year of Indian independence: 1947. Is 1947 prime? Find its prime factorisation.
PRACTICE EXERCISE 13.B — Medium (Classes 6–8)
1. Prove: For prime p ≥ 5, one of p−1 and p+1 is divisible by 6. Use this to show p^2≡1(mod 24).
2. Verify: 1729=12^3+1^3=10^3+9^3. Find the prime factorisation of 1729. Is 1729 a Carmichael number?
3. Using the PNT, estimate the number of primes between 1,00,000 and 2,00,000. Compare with exact count.
4. Find all the primes among the first 20 Fibonacci numbers and check each.
5. Find all Mersenne numbers M_p=2^p−1 for p=2,3,5,7,11,13. Which are prime? Factorise the composites.
6. Show that 1105=5×13×17 is a Carmichael number using Korselt's Criterion.
7. Investigate: For which n does n^2−1 have exactly 4 prime factors? Find all such n<20.
8. Prove: If both p and p+2 are prime (twin primes with p>3), then p+1 is divisible by 6.
9. Find all 3-digit palindrome primes.
10. The AKS primality test has time complexity O((log n)^6). Estimate how many operations to test a 100-digit number for primality.
PRACTICE EXERCISE 13.C — Challenge (Classes 7–10)
1. Dirichlet's Theorem: For coprime a and d, there are infinitely many primes of the form a+kd. Verify for (a,d)=(1,4): infinitely many primes ≡1(mod 4).
2. Prove: There are no prime-forming polynomial f(n) with integer coefficients that produces only primes for all positive integer inputs n.
3. Green-Tao Theorem (2004, unproven here but verify): The prime numbers contain arbitrarily long arithmetic progressions. Find a 5-term arithmetic progression of primes.
4. Investigate the Riemann Hypothesis connection: the prime counting function π(n) and Li(n). Compute the error π(n)−Li(n) for n=10,100,1000 and observe the pattern.
5. Prove Bertrand's Postulate for n≤4: (a) n=2: prime 2 in (2,4]? (b) n=3: prime in (3,6]? (c) n=4: prime in (4,8]?
6. The distribution of primes in arithmetic progressions: Among primes p≤1000, how many satisfy p≡1(mod 4)? How many satisfy p≡3(mod 4)? Are they approximately equal?
7. Prove: If N>6 is even and composite, then N can be written as a product of two numbers neither of which is prime.
8. (Project) Research the Miller-Rabin probabilistic primality test. How does it use Fermat's Little
Theorem? Implement it on paper for N=341 with base a=2.
CHAPTER 13 — KEY POINTS SUMMARY
1. Primes: exactly 2 factors. Composites: 3+ factors. 1: neither.
2. Trial division up to √N is the basic primality test.
3. 6k±1 Rule: Every prime > 3 is of form 6k+1 or 6k−1.
4. Prime families: twin (gap 2), cousin (gap 4), sexy (gap 6), Mersenne (2^p−1), Fermat
(2^{2^n}+1).
5. Sophie Germain primes: p and 2p+1 both prime. Related safe primes used in cryptography.
6. Emirp: prime whose digit-reversal is a DIFFERENT prime.
7. Prime gaps can be arbitrarily large (proof via factorials).
8. Prime Number Theorem: π(N) ≈ N/ln(N). Primes thin out logarithmically.
9. Mersenne primes (51 known) all have prime exponents; not all prime exponents give
Mersenne primes.
10. Wilson's Theorem: p prime ⇔ (p 1)! ≡ −1 (mod p).∢
11. Carmichael numbers (561=3×11×17) fool Fermat primality tests.
12. RSA encryption uses product of two large primes for security.
13. Cicadas use prime life cycles (13,17) to minimize predator synchronization.
14. AKS test (2002, IIT Kanpur): primality testable in polynomial time. Indian achievement!
15. Riemann Hypothesis (unsolved): deepest connection between primes and analysis.
16. For prime p≥5: p^4 ≡ 1 (mod 120); p^2 ≡ 1 (mod 24).
17. Bertrand's Postulate: always a prime between n and 2n.
ANSWER KEY — CHAPTER 13
Exercise 13.A (Easy)
1. (a) prime (b) 17² composite (c) 19² composite (d) prime (e) prime 2. (a) 3 × 67 (b) 7 × 29 (c) 13 × 23 (d) 7 × 43 (e) 17 × 19 — all composite 3. (a) 211, 223, 227, 229, 233, 239, 241 (b) 503, 509, 521, 523, 541, 547 (c) 907, 911, 919, 929, 937, 941, 947 4. (a) twin (b) cousin (c) sexy (d) twin 5. 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 197, 199 6. 113, 131, 173, 179, 191 7. 12! ≡ 12
| ≡ −1 (mod 13) ; 16! ≡ 16 ≡ −1 (mod 17) ; 7! = 5,040 ≡ 0 (mod 8), not −1, so the theorem fails for ✓ | ✓ |
the composite 8 8. 28 emirps: 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389, 701, 709, 733, 739, 743, 751, 761, 769, 907, 937, 941, 953, 967, 971, 983, 991 9. 2023 = 7 × 17², 2024 = 2³ × 11 × 23, 2025 = 3⁴ × 5², 2026 = 2 × 1013 — all composite; the nearest primes are 2017 and 2027 10. 1947 = 3 × 11 × 59 — composite
Exercise 13.B (Medium)
1. p ≡ 1 or 5 (mod 6), so 6 divides p − 1 or p + 1; also (p − 1)(p + 1) is a product of consecutive even numbers, so divisible by 8. Hence 24 | p² − 1 2. 1729 = 7 × 13 × 19; 6, 12 and 18 all divide 1728, so 1729 is a Carmichael number 3. Estimate 2,00,000/ln 2,00,000 − 1,00,000/ln 1,00,000 ≈ 7,700; exact count 8,392 4. 2, 3, 5, 13, 89, 233, 1597 5. M₂ = 3, M₃ = 7, M₅ = 31, M₇ = 127, M₁₃ = 8,191 are prime; M₁₁ = 2,047 = 23 × 89 6. 1104 is divisible by 4, 12 and 16 → Carmichael 7. n = 5 only (5² − 1 = 24 = 2³ × 3) 8. p > 3 twin prime: p ≡ 5 (mod 6) (if p ≡ 1, then p + 2 is a multiple of 3), so p + 1 ≡ 0 (mod 6) 9. 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929 10. log₂(10¹ ) ⁰⁰ ≈ 332; 332⁶ ≈ 1.4 × 10¹⁵ operations
Exercise 13.C (Challenge)
1. Dirichlet proved infinitely many primes ≡1(mod 4): 5,13,17,29,37,41,53,61,73,89,97... 2. Proof: If f(n_0)=p, then f(n_0+kp)≡0(mod p) for all k. 3. Green-Tao: primes in AP examples: 5,11,17,23,29 (diff=6, 5 terms) 4. Compute π(n)-Li(n) for n=10: 4-5.1=-1.1; n=100: 25-29.1=-4.1; n=1000: 168-✓ 176.6=-8.6; always negative (Li overestimates) 5. (a) 3 (2,4] (b) 5 (3,6] (c) 5 (4,8] 6. Primes∈ ✓ ∈ ✓ ∈ ✓ ≡1(mod 4): roughly half of all primes. Among primes to 1000: Dirichlet density = 1/2 (since φ(4)=2). About 78 of 168 primes ≤1000 are ≡1(mod 4): actual count~80. 7. If N>6 even composite: N=2k with k>3. If k prime, N=2×k (semiprime). If k composite, N=2×a×b with a,b>1. Done. 8. Research project: Miller-Rabin for N=341, base a=2. 340=4×85. 2^340≡1(mod 341) but 341 is composite! 341=11×31 is a Poulet number.
CHAPTER 13 — NEW TERMS FOR GLOSSARY
| Term | Definition |
|---|---|
| AKS Test | 2002 polynomial-time primality algorithm by Agrawal, Kayal, Saxena (IIT |
Kanpur).
| Bertrand's Postulate | For every n>1, there is a prime p with n<p≤2n. Proved by Chebyshev (1852). |
| Carmichael Number | A composite N satisfying a^N≡a (mod N) for all integers a. Smallest: |
561=3×11×17.
| Circular Prime | A prime where all cyclic rotations of its digits are also prime. Example: 197 |
(971, 719 also prime).
| Cousin Primes | A prime pair (p, p+4) where both are prime. Example: (7,11), (37,41). |
| Emirp | A prime whose digit-reversal is a different prime. Example: 13 and 31. |
| Fermat Prime | A prime of the form 2^(2^n)+1. Only 5 known: 3,5,17,257,65537. |
| Mersenne Prime | A prime of the form 2^p−1 where p is prime. 51 known as of 2024. |
| Prime Gap | The difference between consecutive primes. Can be arbitrarily large. |
| Prime Number Theorem | π(N) ≈ N/ln(N): primes become rarer as numbers grow, at rate 1/ln(N). |
| Safe Prime | A prime q=(p+1)/2 where (2q−1)/2=p is also prime. Used in Diffie-Hellman. |
| Sexy Primes | A prime pair (p, p+6). Named from Latin "sex"=6. Example: (5,11), (7,13). |
Sophie Germain Prime A prime p where 2p+1 is also prime. Named after French mathematician Sophie
Germain.
| Twin Prime | A prime pair (p, p+2) both prime. Example: (11,13), (41,43). Infinitely many? |
Unsolved.