Begin Algo
Algorithms · 4 lessons

Math & Number TheoryThe maths that keeps coming up

This is not number theory for its own sake — it is the few tools that algorithm problems keep needing: greatest common divisor, prime sieves, modular arithmetic and fast exponentiation, and counting. They show up again and again in cryptography, hashing and counting problems.

Why learn Math & Number Theory

Where it shows up
RSA behind HTTPS

Public-key encryption runs on large primes and modular arithmetic: generating primes, computing modular inverses, doing modular exponentiation. Every lesson here is one of its parts.

→ Lesson: Modular Arithmetic
Aspect ratios and reducing fractions

1920×1080 is 16:9 because of the greatest common divisor. Fraction arithmetic, aligning periods and gear ratios are the same tool.

→ Lesson: GCD & LCM
"How many ways are there?"

How many paths from corner to corner, how many five-card hands. Binomial coefficients are everywhere in counting and probability — just watch for overflow and remember to take the modulus.

→ Lesson: Combinatorics

Lessons

4 lessons