Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Modular Wheel


Numbers grouped by their remainder when divided.

šŸ‘†Tap or hover any slice for details
Zero class (principal) — multiples of 6Class 1 — remainder 1 mod 6Class 2 — remainder 2 mod 6Class 3 — remainder 3 mod 6Class 4 — remainder 4 mod 6Class 5 — remainder 5 mod 6ā˜… 012345mod 6
ā˜… 0 (zero class)
r=1
r=2
r=3
r=4
r=5





Key Terms



Key Terms

Modular arithmetic — arithmetic on remainders. Given a divisor (or modulus) nn, every integer is replaced by its remainder when divided by nn, an integer in the range {0,1,…,nāˆ’1}\{0, 1, \dots, n - 1\}.

Modulus / divisor $n$ — the integer you divide by. On this tool, nn ranges from 22 to 99 (the slice count).

Remainder — the leftover after integer division. For a=qn+ra = qn + r with 0≤r<n0 \leq r < n, the remainder is rr, written aā€Šmodā€Šn=ra \bmod n = r.

Congruence $a \equiv b \pmod n$ — read *aa is congruent to bb modulo nn*. True when aa and bb leave the same remainder when divided by nn, equivalently when nn divides aāˆ’ba - b.

Equivalence class / residue class — the set of all integers sharing the same remainder. There are exactly nn classes mod nn, labeled [0],[1],…,[nāˆ’1][0], [1], \dots, [n - 1].

Zero class (principal class) — the class [0][0], containing 00 and all multiples of nn. It's the identity element of the ring Z/nZ\mathbb{Z}/n\mathbb{Z} and corresponds to the principal ideal nZn\mathbb{Z}. The tool highlights this class with a gold star and warm color.

$\mathbb{Z}/n\mathbb{Z}$ — the integers mod nn, the set of nn equivalence classes with addition and multiplication inherited from Z\mathbb{Z}.

Getting Started

The tool opens with divisor n=6n = 6 and a count target of 3636. The scene splits into three areas:

• A control panel on the left with inputs for the count target, the divisor (a button grid for n=2n = 2 through 99), a speed slider, and Run / Stop / Reset buttons.

• A circular wheel in the middle, divided into nn equal slices. Each slice is one remainder class. The zero class sits at the top (12 o'clock) marked with a gold star ā˜….

• A context panel on the right that switches modes depending on what's happening: an *overview* before running, a *now placing* log while running, a *class details* card when you hover or pin a slice, and a *run complete* summary at the end.

To run:

• Set the count target — the number of integers to sort (1 through that target).

• Pick a divisor in the grid.

• Press ā–¶ Run — numbers 1,2,3,…1, 2, 3, \dots appear one at a time, each placed in its remainder slice with rows filling outward from the center.

• Hover or click a slice to see its formula, examples, and any numbers already placed there.

• Reset to clear and try a different combination.

The Wheel and Slices

The wheel divides a circle into nn equal slices, one per remainder class. Five things to watch:

• Slice labels outside each slice show the remainder value: 00 at the top, then 1,2,…,nāˆ’11, 2, \dots, n - 1 going clockwise.

• Slice colors use a blue palette so the zero class can stand apart. The zero slice has a warmer fill and a thin gold accent arc along its outer edge.

• Rows within each slice run from the center outward — row 11 is closest to the center, row 22 above it, and so on. Each row holds the next occurrence of that class.

• Numbers in cells are drawn rotated so they always read upright relative to the slice they sit in. A label like *36* in slice 00 row 66 tells you 36=6ā‹…6+036 = 6 \cdot 6 + 0, the sixth multiple of 66.

• Center label shows *mod nn* — the modulus currently in effect.

Cells are placed in real time as the run progresses. The geometry adapts to the available width: bigger screens get a larger wheel with taller rows; smaller screens compress the row height. The control panel shows a max-count cap for the current divisor — going beyond it would make labels unreadable.

Run Controls and Speed

The control panel offers three transport actions and a speed slider:

• ā–¶ Run — starts placing numbers from 11 up to the count target, one per tick. Disabled while the input is invalid (empty, non-numeric, below 11, or above the geometric max).

• ā¹ Stop — halts placement at the current number. The wheel keeps what's there; press Run again to start fresh from 11.

• Reset — clears all placed cells, unpins any class, and restores the idle state.

• Speed slider with tortoise 🐢 and hare šŸ‡ markers controls the tick delay. The tick interval is roughly max⁔(20,400āˆ’35ā‹…speed)\max(20, 400 - 35 \cdot \text{speed}) milliseconds — at speed 11 each number takes about 365365 ms; at speed 1010 each takes about 5050 ms.

While running, the right panel switches into *now placing* mode and shows live arithmetic for the most recent number: nĆ·d=qn \div d = q remainder rr, and which slice and row it just landed in. Numbers in the zero class get extra emphasis to call out the divisibility.

Hovering and Pinning Classes

Every slice on the wheel is interactive:

• Hover any slice — a floating tooltip appears showing the class title, formula, description, and example numbers. The right panel simultaneously switches into *class details* mode with the same information plus the list of numbers already placed in that class.

• Click to pin the class — the tooltip stays put, the slice darkens slightly, and the right panel keeps showing details until you click somewhere else (or click the same slice again to unpin).

• Click anywhere outside any slice to clear the pin.

The tooltip layout adapts to viewport edges — it flips to the left of the cursor when too close to the right edge and above when too close to the bottom. Pinned tooltips show a *šŸ“Œ Pinned* indicator at the bottom; hover-only tooltips show *Tap to pin*.

The class details panel includes:

• The formula — n=nkn = nk for class 00, or n=nk+rn = nk + r for class rr.

• A list of first 88 examples of integers in the class.

• A *Placed so far* block listing every number from the current run that landed in this class, if any.

The Zero Class — Why It's Special

Class [0][0] — the multiples of nn — gets special visual treatment: it's centered at 1212 o'clock, marked with a gold star ā˜…, outlined with a warm-gold accent arc, and labeled prominently in the legend.

The emphasis is mathematical, not cosmetic. The zero class is the principal class:

• It contains the integer 00, which is the additive identity of Z/nZ\mathbb{Z}/n\mathbb{Z}.

• It's the only class where *divisibility by nn* is true — every member is an exact multiple of nn.

• Every other class is the zero class shifted: class [r]=[0]+r[r] = [0] + r.

• In ring theory it corresponds to the principal ideal nZn\mathbb{Z}.

• It's the kernel of the canonical map Z→Z/nZ\mathbb{Z} \to \mathbb{Z}/n\mathbb{Z} — the integers that get sent to 00 under modular reduction.

For applications, the zero class is what you test for divisibility, what triggers modular conditions like *check if nn is a multiple of 77*, and what determines whether a number has an inverse in Z/nZ\mathbb{Z}/n\mathbb{Z} (nonzero residues coprime to nn do; zero never does).

Adjusting Divisor and Count

Two inputs control the size and shape of the wheel:

• Count up to sets the upper bound of the integers placed during a run. Range starts at 11 and is capped per divisor by a geometric maximum — the cap ensures rows fit at the minimum readable cell height. The cap appears below the input as *max for divisor nn: M*. Common caps at default width: divisor 22 allows roughly 8080 numbers, divisor 99 allows much more since rows are spread across more slices.

• Divisor (number of slices) is an eight-button grid for n=2,3,4,5,6,7,8,9n = 2, 3, 4, 5, 6, 7, 8, 9. Picking a new divisor immediately clears any in-progress run and re-divides the wheel. The wheel resizes and re-labels each slice.

Try these comparisons:

• Divisor $2$ — split into even and odd halves. Class 00 = evens, class 11 = odds.

• Divisor $10$ — slice rr holds every integer whose last digit is rr. Useful intuition for base-1010 digit patterns.

• Divisor $7$ — counting from 11 takes seven numbers to complete one row across all slices. Mimics the day-of-week shift.

• Same number, different divisors — keep the count fixed at 3030 and step through divisors 22 to 99 to see how class sizes change.

Right Panel Context

The right panel adapts to whichever phase the visualization is in:

• Overview (idle) — appears before the first run. Confirms which divisor is selected and prompts you to press Run.

• Now placing (running) — shows the most recent number, its division arithmetic (nĆ·d=qn \div d = q remainder rr), which class it landed in, and which row within that class. Zero-class hits get a *divisible by nn* accent.

• Class details (hover/pin) — appears whenever a slice is hovered or pinned. Shows the formula, first eight examples, and any run-placed numbers in this class.

• Run complete (summary) — appears after the count target is reached. Lists the divisible numbers in the zero class as the headline, then a grid showing the count per class.

Below the adaptive box sits a static deep-dive section with five collapsible-looking subsections: *What is modular arithmetic*, *Equivalence classes*, *The zero class — why it's special*, *How to read this wheel*, and *Try this*. These are always available and don't change with state — they're reference material to read alongside experimenting on the wheel.

What Is Modular Arithmetic

Modular arithmetic replaces each integer with its remainder when divided by a fixed modulus nn. The result is always one of {0,1,…,nāˆ’1}\{0, 1, \dots, n - 1\}, no matter how big the input.

The fundamental notation is congruence:

a≔b(modn)ā€…ā€ŠāŸŗā€…ā€Šn∣(aāˆ’b)a \equiv b \pmod n \iff n \mid (a - b)


That is, aa and bb are *congruent modulo nn* when their difference is a multiple of nn, equivalently when they leave the same remainder.

Examples:

• Clock arithmetic is mod 1212 (or mod 2424). 1414 o'clock ≔2\equiv 2 o'clock (mod12)\pmod{12}.

• Days of the week are mod 77. If today is Wednesday, day 100100 from now is Wednesday +100ā€Šmodā€Š7=+ 100 \bmod 7 = Wednesday +2+ 2 = Friday.

• Parity is mod 22. *Even* means ≔0(mod2)\equiv 0 \pmod 2; *odd* means ≔1(mod2)\equiv 1 \pmod 2.

• Cryptography — RSA, Diffie-Hellman, elliptic-curve protocols all operate in Z/pZ\mathbb{Z}/p\mathbb{Z} or Z/nZ\mathbb{Z}/n\mathbb{Z} for very large nn.

• Hashing and indexing — converting arbitrary integers into a fixed range {0,…,nāˆ’1}\{0, \dots, n - 1\} is exactly modular reduction.

The operations of addition, subtraction, and multiplication on classes are well-defined: (a+b)ā€Šmodā€Šn=((aā€Šmodā€Šn)+(bā€Šmodā€Šn))ā€Šmodā€Šn(a + b) \bmod n = ((a \bmod n) + (b \bmod n)) \bmod n, and likewise for multiplication. Division (modular inverse) exists only when gcd⁔(a,n)=1\gcd(a, n) = 1.

For deeper coverage, see the modular arithmetic section on the number theory page.

Equivalence Classes and Their Structure

For a fixed modulus nn, the integers Z\mathbb{Z} split into exactly nn disjoint equivalence classes:

Z=[0]āŠ”[1]āŠ”ā‹ÆāŠ”[nāˆ’1]\mathbb{Z} = [0] \sqcup [1] \sqcup \dots \sqcup [n - 1]


Each class [r][r] is the set {r+kn:k∈Z}\{r + kn : k \in \mathbb{Z}\} — an infinite arithmetic progression spaced nn apart on the number line.

Properties:

• Every integer belongs to exactly one class.

• Two integers are in the same class iff they're congruent mod nn.

• Class [r][r] contains negative numbers too: āˆ’7≔5(mod12)-7 \equiv 5 \pmod{12} because āˆ’7+12=5-7 + 12 = 5.

• Class sizes are infinite in Z\mathbb{Z}; on the wheel they look finite only because we cut the count at the target.

The set of classes is a ring. Define [a]+[b]=[a+b][a] + [b] = [a + b] and [a]ā‹…[b]=[aā‹…b][a] \cdot [b] = [a \cdot b] on representatives, then check the result doesn't depend on which representatives you picked. The result is the ring Z/nZ\mathbb{Z}/n\mathbb{Z}:

• Always associative, commutative, with multiplicative identity [1][1].

• A field exactly when nn is prime — then every nonzero class has a multiplicative inverse.

• When nn is composite, some classes are zero divisors: nonzero [a],[b][a], [b] with [a]ā‹…[b]=[0][a] \cdot [b] = [0]. For instance, in Z/6Z\mathbb{Z}/6\mathbb{Z}, [2]ā‹…[3]=[6]=[0][2] \cdot [3] = [6] = [0].

The wheel visualizes the additive structure: shifting all numbers by +1+1 rotates everything one slice clockwise. Multiplicative structure is harder to picture but underlies most applications.

Related Concepts

Greatest common divisor (gcd) — closely tied to modular arithmetic. The Euclidean algorithm computes gcd⁔(a,b)\gcd(a, b) using repeated modular reduction. An integer aa has a multiplicative inverse mod nn iff gcd⁔(a,n)=1\gcd(a, n) = 1.

Euler's totient $\varphi(n)$ — counts integers in {1,…,nāˆ’1}\{1, \dots, n - 1\} that are coprime to nn. Equivalently, the number of invertible classes in Z/nZ\mathbb{Z}/n\mathbb{Z}. For prime nn, φ(n)=nāˆ’1\varphi(n) = n - 1.

Fermat's little theorem — for prime pp and aa coprime to pp: apāˆ’1≔1(modp)a^{p-1} \equiv 1 \pmod p. Generalizes to Euler's theorem aφ(n)≔1(modn)a^{\varphi(n)} \equiv 1 \pmod n.

Chinese Remainder Theorem — if gcd⁔(m,n)=1\gcd(m, n) = 1, the system x≔a(modm)x \equiv a \pmod m and x≔b(modn)x \equiv b \pmod n has a unique solution mod mnmn. Lets you reconstruct an integer from its residues in different moduli.

Modular exponentiation — computing akā€Šmodā€Šna^k \bmod n efficiently via repeated squaring. The core operation in RSA.

Discrete logarithm — given g,h,ng, h, n, find kk with gk≔h(modn)g^k \equiv h \pmod n. Hard in general; security of Diffie-Hellman depends on it.

Quadratic residues — integers that are squares mod nn. Class [r][r] is a quadratic residue mod nn if there exists xx with x2≔r(modn)x^2 \equiv r \pmod n.

Congruence equations — solving ax≔b(modn)ax \equiv b \pmod n. Has a solution iff gcd⁔(a,n)\gcd(a, n) divides bb.

Modulo calculator — to compute aā€Šmodā€Šna \bmod n for arbitrary integers, see the modulo calculator.