Number Theory (Intermediate)
Time limit: 45 minutes
Total marks: 60
Instructions: Show all working. Derivations must be from scratch — no citing results without justification where a proof is requested. Use for mathematics.
Question 1. (10 marks) (a) Prove the divisibility rule for 11: an integer is divisible by 11 if and only if the alternating sum of its digits is divisible by 11. State clearly the property of that drives the proof. (6)
(b) Using your rule, determine whether is divisible by 11, showing the alternating sum. (4)
Question 2. (10 marks) Prove from first principles that is irrational. Your proof must:
- state the assumption you contradict, (2)
- use the fact that a fraction can be taken in lowest terms, (2)
- derive that both numerator and denominator are even, (4)
- conclude the contradiction cleanly. (2)
Question 3. (12 marks) (a) Use the Euclidean algorithm to compute , showing each division step. (4)
(b) Run the Extended Euclidean algorithm to find integers with Show your back-substitution or table clearly. (6)
(c) State Bézout's identity in general and verify your satisfy it. (2)
Question 4. (10 marks) Write, from memory, pseudocode (or Python) for the recursive Extended Euclidean Algorithm that returns with .
- Give the base case. (3)
- Give the recursive step with the correct coefficient update. (5)
- Explain in one sentence why the coefficient update is correct. (2)
Question 5. (10 marks) Solve the simultaneous congruence system using the Chinese Remainder Theorem:
- Show the modular inverses you compute. (6)
- Give the unique solution modulo . (4)
Question 6. (8 marks) (a) State Fermat's Little Theorem precisely, including the hypothesis on and . (3)
(b) Use it to compute without expanding the power. Show the exponent reduction. (5)
Answer keyMark scheme & solutions
Question 1 (10 marks)
(a) Proof of the rule for 11 (6): Write (digits ). (1) Key fact: , hence . (2) Therefore (2) So (alternating digit sum). Both directions follow since congruence mod 11 is an equivalence. (1)
(b) Test (4): Digits from units up: . Alternating sum . (3) , divisible by 11, so is divisible by 11. (1) (Check: .)
Question 2 (10 marks)
Assume is rational: with , . (2) Take the fraction in lowest terms, so . (2) Then , so is even is even (odd² is odd). Write . (2) Substitute: , so even even. (2) Then and , contradicting . Hence is irrational. (2)
Question 3 (12 marks)
(a) Euclidean algorithm (4): So . (4)
(b) Extended (6): back-substitute: (4) So : (2)
(c) Bézout (2): For any integers (not both 0), there exist with . (1) Verification: . ✓ (1)
Question 4 (10 marks)
def ext_gcd(a, b):
if b == 0: # base case (3)
return (a, 1, 0) # gcd=a, a*1 + 0*0 = a
g, x1, y1 = ext_gcd(b, a % b) # recurse (2)
x = y1 # coefficient update (2)
y = x1 - (a // b) * y1 # (1)
return (g, x, y)Why correct (2): If and , substituting gives , matching the returned .
Question 5 (10 marks)
Moduli , ; . (1) Inverses:
- , need . (2)
- , inverse . (2)
- , inverse . (1)
(3) (1) Solution: . (Check: ✓, ✓, ✓)
Question 6 (8 marks)
(a) FLT (3): If is prime and , then . (Equivalently for all .)
(b) Compute (5): , , so . (2) , so . (2) . Answer: . (1)
[
{"claim":"918082 divisible by 11 and alt sum = -22", "code":"n=918082; alt=2-8+0-8+1-9; result=(n%11==0) and (alt==-22)"},
{"claim":"Bezout: 1071*(-3)+462*7 = gcd(1071,462)=21", "code":"from sympy import gcd; result=(1071*(-3)+462*7==21) and (gcd(1071,462)==21)"},
{"claim":"CRT solution 23 satisfies all three congruences", "code":"x=23; result=(x%3==2) and (x%5==3) and (x%7==2)"},
{"claim":"3**100 mod 7 = 4", "code":"result=(pow(3,100,7)==4)"}
]