#>arithmetic_with_memory
primes congruence divisibility

Math / Pure Structure

Number theory is arithmetic that remembers structure.

Addition and multiplication look familiar in number theory, but familiar operations start leaving visible fingerprints: divisibility, remainders, prime factorization, and cyclic repetition. The field is deep because the integers are simple enough to doodle and stubborn enough to keep surprising you. If you want the nearest algebraic continuation, go next to field theory; if you want the software-facing echo, go to parsers.

A clustered study of luminous cubes and folded blocks suggesting repeating residue classes and discrete arithmetic structure.
Residue lattice Discrete blocks falling into repeating neighborhoods, close to the modular clock and the jump into prime fields.
.intuition_first

Intuition First

A good first feeling for number theory is that integers carry more memory than real-number arithmetic suggests. Ask whether one number divides another, or what remains after division, and suddenly arithmetic stops being smooth and starts forming textures: periodicity, factor families, prime bottlenecks, and repeating cycles. The divisibility handles below turn that feeling into a few reusable ideas.

This is why clocks are such a useful entry point. A clock throws away full turns and remembers only the residue class. That small act of forgetting is mathematically productive. It lets you see congruence as a pattern language: two numbers can be different in the usual sense and still be the same from the perspective of a chosen modulus, which is exactly the move that prepares you for prime fields.

Prime numbers

Primes act like structural atoms. They are not the only important objects, but many later patterns depend on how integers break into prime pieces.

anchor: divisibility handles

Congruence

Saying two numbers are congruent modulo n means they land in the same residue class after division by n.

anchor: modular clock

Field bridge

Prime moduli are special because modular arithmetic modulo p behaves cleanly enough to form a field.

next: prime fields
^"modular_clock"{

Portable Diagram: Multiplication On A Clock

This SVG diagram maps each residue i to k × i (mod n). When the modulus is prime, the nonzero residues behave more cleanly; when the modulus shares factors with the multiplier, the pattern folds inward and exposes divisibility. That contrast is the bridge into field theory and a useful analogy for parser equivalence classes.

Modular multiplication clock A modular arithmetic clock diagram that updates when the modulus and multiplier controls move.
If the controls are unavailable, read the default picture as multiplication by 5 on a 12-hour clock. The diagram still shows the basic idea: modular arithmetic turns numbers into recurring positions.

Move the controls to compare prime and composite moduli.

~"visual_handles"

Divisibility Handles

?prime

Prime

A prime is a number with no nontrivial divisors. In number theory, primes often mark the points where arithmetic becomes cleaner or more rigid.

field theory anchor: prime fields
~gcd

Greatest Common Divisor

The gcd tells you how much two numbers overlap structurally. In the modular clock, it controls whether the pattern permutes or collapses.

anchor: modular clock
^residue

Residue Class

Residues are arithmetic positions remembered after full turns are forgotten. They are the central visual objects in modular arithmetic.

category anchor: composition square
&euclid

Euclidean Habit

The Euclidean algorithm is a way of thinking, not only a procedure: keep dividing, keep tracking remainders, and structure eventually appears.

complexity anchor: growth intuition
&["neighbor_routes"]

Neighbor Routes

Field Theory

Finite fields often begin with modular arithmetic modulo a prime. Number theory supplies the raw material that field theory organizes.

route: Prime fields

Combinatorics

Residue classes, partitions, and finite counting arguments often overlap, especially when periodicity or recurrence matters.

route: Combinatorics intuition

Category Theory

Category language can make arithmetic feel less isolated by treating operations and preserved structure as first-class relationships.

route: Category insight

Parsers

Even bespoke parser design benefits from number-theoretic habits: small generators, repeating states, and residue-like equivalence classes.

route: Parser doodles