Visual walkthrough — Chinese Remainder Theorem (intro)
We will solve one concrete pair of clues the whole way down:
Read out loud: "the number I want leaves remainder when divided by , and remainder when divided by ." (Again — the notation is defined precisely in Step 1.)
Step 1 — Draw each clue as a ladder of dots
WHAT. A congruence like does not name one number — it names a whole family: , each one apart. Same for : the family , each apart.
WHY. Before hunting for a single answer, we must see that each clue is not a point but an evenly-spaced comb of allowed positions. The answer is wherever two combs line up.
PICTURE. Look at the figure. The number line runs to . Cyan dots mark the family that satisfies clue 1 (spacing ). Amber dots mark clue 2 (spacing ). Notice how each comb has its own rhythm.

Step 2 — The answer is where the two combs collide
WHAT. Overlay the two combs. There is exactly one column, inside , where a cyan dot and an amber dot land together. That column is our solution.
WHY. A number satisfies both clues precisely when it belongs to both families — a shared tooth. Finding is nothing more mysterious than finding the overlap.
PICTURE. The amber highlight ring sits at : (remainder mod ✓) and (remainder mod ✓). And the overlap repeats every — the next shared tooth is , then .

Step 3 — Stop guessing: build the answer from clue 1 outward
WHAT. Instead of scanning for the overlap, we construct it. Start by obeying clue 1 automatically: write
Any whole-number choice of keeps on the cyan comb.
WHY. We reduce a two-condition puzzle to a one-condition puzzle. Clue 1 is now free — satisfied for every . All that remains is to pick the that also lands on amber.
PICTURE. Each value of slides us one cyan tooth to the right: , , . The figure shows as an arrow whose base is pinned at and whose length is .

Step 4 — Force clue 2, and a division problem appears
WHAT. Demand that our sliding also satisfies clue 2:
Subtract the from both sides (allowed — you may add/subtract the same thing in modular arithmetic):
WHY. We turned "find " into "find ": which slide-count lands us on amber? The left side is now a clean multiplication we can attack.
PICTURE. The figure lists the candidate values of as : they cycle . We want the entry equal to — it happens at (amber box).

Step 5 — Why the inverse always exists (and why coprimality is the hinge)
WHAT. In Step 4 the cycle hit every remainder exactly once. That is the whole miracle: because and share no factor, multiplying by shuffles the remainders without repeats — so the value is guaranteed to appear, meaning the inverse must exist.
WHY. Bezout's Identity says: if then there are integers with . Read that mod : , so is the inverse. The Extended Euclidean Algorithm is the machine that spits out ; for small numbers we just read them off the cycle.
PICTURE. Two rings. The left ring (multiplying by , coprime to ) has arrows visiting all five spots — one clean cycle, so is reachable. The right ring shows the failure: multiplying by, say, modulo only ever lands on and — the odd remainders are never hit, so does not exist.

Step 6 — Slide back and read off the answer
WHAT. We found , so the smallest slide is . Plug back into :
And because could be (any ), jumps by each time:
WHY. This closes the loop with Step 2: we predicted the collision at by pure construction, no scanning. The repeat-period falls out automatically from the leftover freedom in .
PICTURE. The arrow from Step 3, now locked at length , lands its tip exactly on the amber-ringed dot at from Step 2. The two views agree.

Step 7 — Repackage the same work as the parent's formula
WHAT. The parent's formula reads . Here is simply the remainder demanded by clue — the numbers on the right of each congruence. In our problem (remainder mod ) and (remainder mod ). Let us recognise our hand-work inside the formula.
- — the repeat period we already met.
- : divisible by , so it vanishes mod but not mod .
- : divisible by , so it vanishes mod but not mod .
- and .
WHY. Each term is an on/off switch: it equals (the demanded remainder) in its own modulus and in every other. Adding them stacks the clues without interference — because the are built to be zero elsewhere.
PICTURE. Two horizontal bars. Term shows " mod 3, mod 5". Term shows " mod 3, mod 5". Their sum .

The one-picture summary
WHAT. Everything on one canvas: two combs (clue 1 cyan, clue 2 amber) collide at ; the "build from clue 1, solve for the slide " arrow reaching that dot; and the switch-term bars stacking to the same . Three routes, one answer.

Recall Feynman retelling — say it back in plain words
Two clues, each a comb of evenly-spaced allowed numbers — one comb every steps, one every . I want a spot on both combs. Rather than search, I stand on the first comb by writing my number as "start at , then hop at a time." Now I just need the right number of hops so I also land on the second comb. That "right number of hops" is a division-in-disguise, , whose answer is the modular inverse of . That inverse is guaranteed to exist only because and share no factor — coprimality means multiplying shuffles all remainders, so the value I need is always reachable; if they shared a factor, multiplication would skip remainders and my inverse could be missing. I take the hops, land on , and because leftover freedom repeats every , the answer is . The textbook's formula is just the same idea prewrapped: each term is a switch that says my remainder in its own comb and stays invisible in the others. This is the engine behind RSA Cryptography and Fermat's Little Theorem speed-ups.
Recall
Why is there exactly one answer between and ? ::: The two combs (spacing and ) only re-sync after the least common multiple (lcm — the smallest number both and divide) , and since that lcm equals , so each block of holds exactly one collision. What equation must solve in the slide method? ::: , whose solution is the modular inverse of mod , namely . Where does coprimality actually get used? ::: It guarantees the modular inverse in Step 4 exists — multiplication by a coprime number visits every remainder, so remainder is reachable. How does term avoid disturbing clue 2? ::: is a multiple of , so the term is — it is switched off outside its own modulus. (Here is the remainder demanded by clue 1.)