Number theory
Follow remainders, prime elimination, integer coefficients, and repeated squaring.
Step forward, return to an earlier state, or scrub the timeline. Applying input begins a new run. Switching compatible algorithms retains the input; other algorithms load their own defaults.
Current state
Operation history
Pseudocode
Each highlighted line corresponds to an operation in the executable trace. Counts describe core algorithm work, excluding validation, snapshots, and rendering.
Read the executable JavaScriptExplore the lessons
- Euclidean algorithm — Find a greatest common divisor through successive remainders.
- Extended Euclidean algorithm — Find a GCD and coefficients explaining how the inputs produce it.
- Sieve of Eratosthenes — Cross out multiples and reveal every prime up to a limit.
- Binary exponentiation — Build large powers by repeated squaring and halving.
Follow the changing state
The data display shows each algorithm’s own variables and intermediate answers. Pink marks current work, amber marks dependencies or a divisor, and green marks a result. Each lesson explains its display, prerequisites, performance, and limitations.