LemmaTechniques › Modular Thinking
Olympiad problem-solving technique

Modular Thinking

When the numbers are too big, shrink the universe.

Reduce everything modulo a well-chosen nn and infinite problems become finite. Powers cycle, squares hit only a few residues (0,1mod40, 1 \bmod 4; 0,1,4mod80, 1, 4 \bmod 8), and impossible equations reveal themselves in a finite check.

Choosing the modulus is the art: mod 4 or 8 for squares, mod 9 for digit sums and cubes, mod pp with Fermat for large exponents.

Where it appears on Lemma: Levels 4 and 7.

Train it on Lemma

Modular Thinking unlocks at Level 4 of Lemma's eight-level ladder, with lessons that teach it and drills that make it stick. 78 lessons, 624 curated problems and unlimited generated practice at six difficulties. Free to start — no card, no trial clock.

Find your level

More techniques