You are staring at a modular arithmetic problem — "find the inverse of 5 mod 7," "solve 4x \equiv 2 \pmod 6," "what is the order of 3 mod 11?" — and nothing obvious presents itself. No clever identity, no Fermat shortcut, no pattern to latch onto. The modulus is small, maybe 5, 6, 7, 8, 9, 10, 11, 12.
Here is the move that will save you: stop thinking and just write the full n \times n multiplication table. Every row, every column, every product reduced mod n. It takes ninety seconds. Once the grid is in front of you, the structure of \mathbb{Z}/n\mathbb{Z} is no longer abstract — it is a picture you can read off.
This is the meta-heuristic: before any algebra, build the table. It is the modular-arithmetic version of trying small cases first, but instead of four scalar values, you get an n^2-cell data table that encodes everything about multiplication in that modulus at a glance.
What the table hands you, for free
A multiplication table for \mathbb{Z}/n\mathbb{Z} is just the grid where the (a, b) cell contains (a \cdot b) \bmod n. Once drawn, three distinct features become visible:
-
Cycles. Each row is the sequence of multiples of a reduced mod n. Reading row a left to right, you see 0, a, 2a, 3a, \ldots — and where it eventually returns to 0 tells you the order of a under multiplication.
-
Inverses. If you want a^{-1} mod n, scan row a for the cell containing 1. The column index of that cell is a^{-1}. One glance. No extended Euclidean algorithm, no guessing.
-
Zero-divisors. A nonzero b for which a \cdot b \equiv 0 \pmod n (with a also nonzero) is a zero-divisor. These stand out as zeros in a nonzero row. They are the residues that fail to have inverses — and they are always exactly the residues that share a factor with n.
The table is, in effect, the definition of \mathbb{Z}/n\mathbb{Z} made visual.
Mod 6 vs mod 7 — a side-by-side
The clearest way to see why this move works is to draw two tables next to each other: one composite modulus and one prime. Mod 6 has zero-divisors and missing inverses. Mod 7 is clean — a field.
The difference between the two grids is the entire content of the theorem "\mathbb{Z}/n\mathbb{Z} is a field if and only if n is prime." You didn't prove anything — you just looked. For a formal animated walk-through of the mod-7 case, see Mod 7 Multiplication Table — Why ℤ/7ℤ Is a Field. The present article is the meta-habit: for any stuck problem with small n, draw the table first.
The inverse lookup, in action
Use the mod-7 table to find the inverse of 5
The question. Find 5^{-1} \pmod 7 — i.e., the residue b satisfying 5 b \equiv 1 \pmod 7.
The table move. Go to row 5. Read it: 0, 5, 3, 1, 6, 4, 2. Find the column where the entry is 1. That's column 3.
The answer. 5^{-1} \equiv 3 \pmod 7. Check: 5 \cdot 3 = 15 = 2 \cdot 7 + 1 \equiv 1 \pmod 7. ✓
Total time: four seconds of reading. No extended Euclidean, no trial multiplication. The table had already computed every inverse before you asked.
Contrast this with trying the same problem mod 6: go to row 5, which reads 0, 5, 4, 3, 2, 1. The column where 1 appears is column 5, so 5^{-1} \equiv 5 \pmod 6. But if you had asked for the inverse of 2 mod 6, row 2 reads 0, 2, 4, 0, 2, 4 — the number 1 never appears. The table is telling you the inverse does not exist. That is the same fact as \gcd(2, 6) = 2 \neq 1, but you didn't need to compute a gcd to see it.
Reading cycles off the table
Another question the table answers instantly: what is the order of a modulo n? The order of a under multiplication is the smallest positive k such that a^k \equiv 1 \pmod n. This sounds like it needs exponentiation, but in fact you can read it off the table using the row of a together with a little repeated lookup.
Start at cell (a, 1) = a. Then go to cell (a, a) — that entry is a^2. Then to (a, a^2), which is a^3. Keep chasing. The number of steps before you land on 1 is the order of a.
For example, in the mod-7 table, start with a = 3. Row 3, column 1: 3. Row 3, column 3: 2. Row 3, column 2: 6. Row 3, column 6: 4. Row 3, column 4: 5. Row 3, column 5: 1. That's six steps, so the order of 3 mod 7 is 6 — and since \varphi(7) = 6, 3 is a primitive root mod 7. The entire theory of primitive roots, which sounds deeply algebraic, is visible as a chase through the cells of your hand-drawn grid.
When not to draw the table
A healthy caution: the table is a hammer, not a universal solvent. Three situations where you should skip it:
- Large moduli. If n = 97 or n = 1009, do not draw a 1009 \times 1009 grid. Use the extended Euclidean algorithm for inverses and Fermat's little theorem for exponentiation.
- Huge exponents with prime modulus. "Compute 7^{1000} \pmod{13}" is a Fermat signal; the table is the wrong tool. See huge exponent + prime modulus signals Fermat.
- Purely additive questions. If the problem is really about addition mod n (say, "what is 47 + 58 \pmod{11}?"), you don't need a multiplication table at all — just reduce and add.
For everything else with n \leq 12, though, the table is your friend.
Why this habit scales
Writing the table becomes less practical as n grows — you don't want to draw a 30 \times 30 grid by hand. But for the moduli that appear in olympiad and JEE-style problems — n \leq 12, nearly always — it is the fastest possible attack. Every single modular-arithmetic fact you can state about \mathbb{Z}/n\mathbb{Z} is encoded in that grid: the group of units, the zero-divisors, Euler's totient \varphi(n) (count the rows that are permutations), the orders of elements (count how many cells before row a first hits 0 or 1), even the Chinese Remainder Theorem's structural fingerprint (for n = 6 = 2 \cdot 3, the table decomposes into a grid of grids).
When a problem asks any question about modular multiplication with small n, your first line on the scratch paper should be the table. Build it. Stare at it. The answer is almost certainly already there — you just have to look.
One-line takeaway
For small n, drawing the full mod-n multiplication table is never wasted effort. It exposes every cycle, inverse, and zero-divisor at a glance — and the answer to most modular-arithmetic exercises with small n is just one cell away.
Related: Modular Arithmetic · Mod 7 Table Reveals Field Structure · Try Small Cases First · Compute 2^{100} mod 7 by Hand · Reduce Factors Mod n Before Multiplying