Math¶
Core Deep
Math gives you the compact facts and transforms that keep many contest solutions short, fast, and correct.
The Dependency Chain That Matters Most¶
Math is the easiest area to overlearn in the wrong order. In this repo, the most important dependency chain is:
Number Theory Basics -> GCD / LCM -> Modular Arithmetic -> CRT / Lucas -> deeper number-theory lanes
If that chain is not stable yet, do not jump early into discrete logs, Min_25, or polynomial / FPS work.
Use This Area When¶
- the real blocker is divisibility, modular arithmetic, counting, or transforms
- brute force is fine in shape but too expensive without number-theory compression
- the clean solution needs one algebraic identity or arithmetic preprocessing trick
Start With One Route¶
| If your bottleneck is... | Open first | Then |
|---|---|---|
| divisibility and primes | Number Theory Basics | GCD / LCM, then Modular Arithmetic |
| congruences and modular calculations | Modular Arithmetic | Chinese Remainder, Lucas Theorem |
| recurrence and algebra tools | Linear Recurrence / Matrix Exponentiation | Gaussian Elimination, Berlekamp-Massey / Kitamasa |
| transforms and polynomial work | FFT / NTT | Polynomial / Formal Power Series |
Core Progression¶
Core first- Number Theory Basics
- GCD / LCM
-
Modular Arithmetic
-
Then add - Chinese Remainder / Lucas Theorem
- Linear Recurrence / Matrix Exponentiation
- Gaussian Elimination
-
Probability / Game Theory / XOR Basis
-
Deep later - BSGS / Discrete Log
- Modular Square Root / Discrete Root
- Primitive Root / Pollard-Rho
- Mobius / Dirichlet Prefix Sums / Min_25
- Berlekamp-Massey / Kitamasa
- FFT / NTT / Polynomial / FPS
Good First Repo Anchors¶
Browse All Subtopics¶
- Modular Arithmetic
- Number Theory Basics
- GCD / LCM
- BSGS / Discrete Log
- Modular Square Root / Discrete Root
- Primitive Root
- Pollard-Rho
- Gaussian Elimination / Linear Algebra
- Chinese Remainder / Linear Congruences
- Lucas Theorem / Large Binomial Mod Prime
- Mobius And Multiplicative Counting
- Dirichlet Convolution / Prefix Sums Of Number-Theoretic Functions
- Min_25 / Du Jiao
- Linear Recurrence / Matrix Exponentiation
- Berlekamp-Massey / Kitamasa
- XOR Basis / Linear Basis
- Game Theory / Sprague-Grundy
- Probability
- FFT / NTT
- Polynomial / Formal Power Series
Go Deeper¶
- Course: MIT 6.1210 / 6.1220
- Reference: CP-Algorithms
- Reference: OI Wiki
- Practice: CSES Problem Set