An interactive introduction to number theory

Patterns,
Proofs, and Primes

Start with a rectangle. Rotate a necklace. Color Pascal’s triangle. Then follow the patterns all the way to a proof.

8 chapters6 live explorations70+ exercises

compute

notice

conjecture

prove

reuse

The course

One idea unlocks the next.

The sequence is a proof journey, not a catalogue: algorithms become structures, structures become symmetry, and symmetry becomes information about primes.

01

Euclid · Bézout · Diophantine equations

The algorithm in a rectangle

Turn repeated division into a proof-producing machine.
02

Primes · Euclid’s lemma · Unique factorization

Every integer has an address

Build arithmetic from the indivisible pieces.
03

Convergents · Approximation · Pell equations

Fractions inside fractions

Read Euclid’s quotients as exceptional approximations.
04

Congruences · Inverses · Chinese remainders

Arithmetic on a clock

Forget complete turns and preserve arithmetic structure.
05

Necklace orbits · Fermat’s little theorem

A theorem you can rotate

Watch divisibility emerge from cyclic symmetry.
06

Groups · Cosets · Lagrange · Euler

The reusable machine

Name the structure shared by clocks and rotations.
07

Binomial coefficients · Valuations · Kummer

Arithmetic in Pascal’s triangle

Find prime divisibility hiding in base-p carries.
08

Central coefficients · θ(x) · Chebyshev

How crowded are the primes?

Use the middle of Pascal’s triangle to count primes.
Designed for a first proof-oriented courseTwo 75-minute meetings per week · no calculus or abstract algebra required
Download the complete 39-page packet

Interactive companion

Touch the structure.

Every experiment is paired with a proof question. Computation is the microscope—not the oracle.

01

Algorithm lab

Tile the rectangle

Change the side lengths. The picture and proof trace update together.

391 × 299final tile: 23 × 23
gcd = 23
391=1 · 299+92
299=3 · 92+23
92=4 · 23+0
Bézout certificate23 = -3(391) + 4(299)
02

Approximation lab

Build a continued fraction

Watch simple fractions close in on an irrational target.

[1;2,2,2,2,2,2]
11error 4.1e-1
32error 8.6e-2
75error 1.4e-2
1712error 2.5e-3
4129error 4.2e-4
9970error 7.2e-5
239169error 1.2e-5
03

Congruence lab

Wind around a clock

Explore residues, units, and the permutation hiding inside a finite group.

mod12
01234567891011
9 + 52(mod 12)

Units modulo 12

15711

Multiplication by 5 rearranges these units:

1 5;5 1;7 11;11 7
04

Symmetry lab

Rotate a theorem

Color the beads, inspect the orbit, and see why prime length forces equal packets.

tap a bead

Rotational orbit · 5 distinct words

0
1
2
3
4
Nonconstant 3-color words353 = 240240 ÷ 5 = 48 complete orbits
05

Divisibility lab

Color Pascal’s triangle

Reduce every entry modulo a prime. Base-p carries become a fractal you can see.

Look for it: blank cells are the coefficients divisible by 2. The repeating blocks are base-2 arithmetic made visible.

06

Prime-counting lab

How crowded are the primes?

Compare exact counting with the scale predicted by Chebyshev and the prime number theorem.

π(x)168exact
x / log x144.8prediction
ratio1.161π(x) ÷ prediction
π(x)x / log x
Chebyshev’s deliberately broad proved interval50.2 ≤ π(1000) ≤ 579.1

Practice architecture

From calculation to explanation.

Weekly work mixes three modes. The aim is not merely to get an answer, but to know what kind of reasoning produced it.

01

Fluency

Focused calculations make later proofs readable.

Example
Express gcd(527, 341) as 527x + 341y.
02

Reasoning

Intermediate claims guide students through complete proofs.

Example
Why does a nonconstant word of prime length have exactly p rotations?
03

Exploration

Generate evidence, form a conjecture, then test its limits.

Example
Color Pascal’s triangle modulo p. What do its repeating blocks know about base p?

The central lesson

Proof is a way of seeing why a pattern had to appear.

Print the formal development. Use the web to experiment. Move between them until the computation and the proof tell the same story.