Lemma › Techniques › Modular Thinking
Olympiad problem-solving technique
Modular Thinking
When the numbers are too big, shrink the universe.
Reduce everything modulo a well-chosen and infinite problems become finite. Powers cycle, squares hit only a few residues (; ), 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 with Fermat for large exponents.
Guides on Modular Arithmetic
- EGMO 2020 Problem 1: solution, and the power of 2 that cannot hideA full solution to EGMO 2020 Problem 1: track the power of 2 in each term, show it climbs by 2 or falls by 1, and count the terms.
- EGMO 2025 Problem 1: solution, and the one pair that breaks the restA full solution to EGMO 2025 Problem 1: why every even N and every power of 3 works, the pair that breaks every other N, and the signal in the statement.
- Lifting the exponent lemma explained for competitionsThe lifting the exponent lemma in one line, the p = 2 version that catches almost everyone, and the signals that tell you a contest problem wants it.
- gcd(2^m − 1, 2^n − 1): the proof, and how to spot itWhy gcd(2^m − 1, 2^n − 1) = 2^gcd(m,n) − 1: run Euclid's algorithm on the exponents. A full proof, a second proof by orders, and where it turns up.
- How to build a problem-solving notebook that actually worksMost problem notebooks are copied solutions nobody reopens. Index yours by the clue in the statement, not by topic, and test it from the clue side.
- What separates a Level 5 problem from a Level 7, side by sideTwo IMO inequalities, both rated 5 out of 6, sit two rungs apart on the ladder. What actually separates a Level 5 problem from a Level 7, and how to cross.
- Number theory problems that look like algebra, and how to tellAn equation, a fraction, a polynomial: it reads like algebra, but the word integer changes the method. Five signals, and the three moves that follow.
- How to revise a topic you understand but keep missingRereading a topic you already understand fixes nothing. Find the one step that keeps breaking, revise that step, and test it cold. Worked on mods and bounds.
- AMC 8 to AMC 10: what actually changesThe AMC 10 is not a harder AMC 8. The clock, the scoring and the length of a question all change, and the scoring flips your most useful AMC 8 habit.
- How many practice problems should you do a day?The daily count is the wrong target. How to size a practice session from your miss rate and review time, and why a mixed set beats a bigger one.
- Which modulus? The real trick in competition number theoryModular arithmetic tricks are one decision wearing many hats: which modulus. The residue table, how to read the modulus off the problem, and when it fails.
- AMC 12 in one month: a plan made of what you cutFour weeks buys around twenty hours. A study plan for the AMC 12 that spends them by naming what to drop: most mocks, the last five questions, every new topic.
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. 128 lessons, 1237 curated problems and unlimited generated practice at six difficulties. Free to start, no card, and the paid plan opens with 3 free days.
Find your levelMore techniques
- Double CountingCount it twice, set the answers equal.
- Ceva & MenelausConcurrency and collinearity are products of ratios.
- All 29 techniques →