QED
Algebra · step 9 of 13

Modular arithmetic basics

Working modulo n means caring only about remainders on division by n. Addition and multiplication respect this, so you may reduce at any point — which is what keeps numbers small. The classic applications are clock arithmetic, checking divisibility, and computing last digits, where "mod 10" turns an enormous power into a short cycle.

Unlimited questions · marked criterion by criterion · no card needed

Method: how to approach it

The order below is what examiners expect to see, and each step carries its own marks.

  1. Reduce to the canonical remainderEvery integer is congruent to exactly one of 0, 1, …, n−1. Reduce early and often.
  2. Add and multiply componentwiseIf a ≡ a′ and b ≡ b′ then a + b ≡ a′ + b′ and ab ≡ a′b′. Reduce after each operation.
  3. Handle negatives by adding n−3 mod 7 is 4, not −3. Answers should be in the canonical range unless stated otherwise.
  4. Find the cycle for powersCompute successive powers until a value repeats; the exponent then reduces modulo the cycle length.

Worked example

Find the last digit of 7²⁰²⁵.

  1. The last digit is the value mod 10.
  2. Powers of 7 mod 10: 7, 49 ≡ 9, 63 ≡ 3, 21 ≡ 1, then the cycle repeats with length 4.
  3. 2025 = 4·506 + 1, so 7²⁰²⁵ ≡ 7¹ (mod 10).
  4. Which is 7.

Answer. The last digit of 7²⁰²⁵ is 7.

Where marks get dropped

These are the specific errors that cost credit on modular arithmetic basics questions — QED's rubric penalises each of them separately.

Practise this until it is automatic

Unlimited fresh questions

QED generates new modular arithmetic basics problems on demand at warm-up, exam and challenge level, so you can drill this one skill until it stops costing you marks.

Marked like an examiner

Every answer is scored against a point-by-point rubric with partial credit, so you see exactly which step of the method broke down — not just a tick or a cross.

Answer in real notation

A one-tap symbol palette, a visual equation editor and a truth-table builder — or photograph your handwritten working and QED converts it to LaTeX.

Saved to your library

Every question you generate is kept and re-takeable as a timed exam, and your Algebra mastery is tracked so you know when this is exam-ready.

Modular arithmetic basics — frequently asked questions

How do I compute a large power mod n by hand?

Repeated squaring: express the exponent in binary and square-and-reduce at each step. This turns hundreds of multiplications into a handful.

Why does modular arithmetic work?

Because congruence mod n is compatible with + and ×, so the remainders form a ring ℤ/nℤ and ordinary algebra applies within it.

Where is it used?

Check digits (ISBN, IBAN), hashing, cryptography (RSA is modular exponentiation), and any wraparound counter in software.

The rest of Algebra

Foundational algebra to close prerequisite gaps. Each subtopic below has its own method, worked example and mark-losing traps.

Ready to make modular arithmetic basics exam-proof?

Generate your first questions free — no card, no setup, no personal data stored. Practise until the method is second nature.

Start practising free →