All revision notes topics

Fermat's little theorem and congruence equationsEdexcel A-Level Further Maths: Revision notes

Section 1

Fermat's little theorem

Fermat's little theorem: if pp is prime and p∤ap\nmid a, then ap−1≡1(modp).a^{p-1}\equiv1\pmod p. An equivalent form is ap≡a(modp)a^p\equiv a\pmod p for every integer aa. The proof is not required. Example: p=7p=7, a=4a=4: 46≡1(mod7)4^6\equiv1\pmod7. Check: 43=64=63+1≡14^3=64=63+1\equiv1, so 46≡14^6\equiv1 as well.

Key termsFermat's little theoremprime
Common mistake

Using Fermat when the modulus is not prime, or when pp divides aa. Check both conditions first.

Section 2

Reducing large powers

To find ak(modp)a^k\pmod p: write k=q(p−1)+rk=q(p-1)+r with 0≤r<p−10\leq r<p-1. Then ak=(ap−1)q ar≡ar(modp)a^k=(a^{p-1})^q\,a^r\equiv a^r\pmod p. Example: 420(mod7)4^{20}\pmod7. 20=3×6+220=3\times6+2, so 420≡42=16≡24^{20}\equiv4^2=16\equiv2. Example: 1250(mod7)12^{50}\pmod7: 12≡512\equiv5 and 50=8×6+250=8\times6+2, so 1250≡52=25≡412^{50}\equiv5^2=25\equiv4. Reduce the base first, then the exponent.

Key termsleast positive residue
Exam tip

For ak+bm+…a^k+b^m+\dots questions, reduce each power separately, then add and reduce.

Section 3

When does ax≡b(modn)ax\equiv b\pmod n have solutions?

Let d=hcf(a,n)d=\text{hcf}(a,n). The congruence ax≡b(modn)ax\equiv b\pmod n has a solution if and only if d∣bd\mid b. When it does, there are exactly dd solutions modulo nn, and if d=1d=1 there is a unique solution modulo nn. Examples: 6x≡4(mod9)6x\equiv4\pmod9 has no solution (d=3∤4d=3\nmid4). 6x≡9(mod15)6x\equiv9\pmod{15}: d=3∣9d=3\mid9, so 33 solutions modulo 1515 (4,9,144,9,14).

Key termssolution set
Common mistake

Stating there is a unique solution when hcf(a,n)>1\text{hcf}(a,n)>1. There are dd solutions modulo nn.

Section 4

Multiplicative inverses and Bezout

If hcf(a,n)=1\text{hcf}(a,n)=1, Bezout gives ax+ny=1ax+ny=1, so ax≡1(modn)ax\equiv1\pmod n: xx is the multiplicative inverse of aa modulo nn. Find it with the Euclidean algorithm and back substitution. Example: 40=2(17)+640=2(17)+6, 17=2(6)+517=2(6)+5, 6=1(5)+16=1(5)+1, so 1=3(40)−7(17)1=3(40)-7(17) and the inverse of 1717 modulo 4040 is −7≡33-7\equiv33. Check: 17×33=561=14(40)+117\times33=561=14(40)+1. To solve ax≡bax\equiv b, multiply by the inverse: 17x≡917x\equiv9 gives x≡9×33=297≡17(mod40)x\equiv9\times33=297\equiv17\pmod{40}.

Key termsmultiplicative inverse
Exam tip

Substitute your answer back into the original congruence to check it.

Section 5

Solving when hcf(a,n)>1\text{hcf}(a,n)>1

If d=hcf(a,n)d=\text{hcf}(a,n) divides bb, divide aa, bb and nn by dd to get a′x≡b′(modn′)a'x\equiv b'\pmod{n'}, which has hcf(a′,n′)=1\text{hcf}(a',n')=1 and a unique solution x≡x0(modn′)x\equiv x_0\pmod{n'}. The solutions modulo nn are x0,  x0+n′,  x0+2n′,…,x0+(d−1)n′x_0,\;x_0+n',\;x_0+2n',\dots,x_0+(d-1)n'. Example: 15x≡9(mod21)15x\equiv9\pmod{21}. d=3d=3, so 5x≡3(mod7)5x\equiv3\pmod7. The inverse of 55 is 33, so x≡9≡2(mod7)x\equiv9\equiv2\pmod7. The solutions are x=2,9,16x=2,9,16 modulo 2121.

Key termsreduced congruence
Common mistake

Dividing aa and bb by dd but leaving the modulus as nn. The modulus must be divided too.

That's the notes covered.

Carry on to the next subtopic.

Exam questions on Fermat's little theorem and congruence equations

  1. Work modulo 77, which is prime.
    Find the remainder when 125012^{50} is divided by 77.2 marks
  2. Linear congruences of the form ax≡b(modn)ax\equiv b\pmod n are to be solved for integers xx.
    Solve 7x≡3(mod11)7x\equiv3\pmod{11}.2 marks
  3. Consider the numbers 1717 and 4040.
    Use the Euclidean algorithm to show that 1717 and 4040 are coprime.3 marks
See the full worksheet

Written by the Exaim team, led by Shaun Daswani (Head of Upper Secondary, Improve ME Institute; MSc Financial Mathematics, Imperial College London; BSc, UCL) and Jason Daswani (operational lead, Improve ME Institute; LSE).