Visual walkthrough — Prime numbers — Sieve of Eratosthenes, primality testing
We build everything from one single idea: a number is a pile of dots, and multiplication is arranging those dots into a rectangle.
Step 1 — What a number looks like (dots in a row)
WHAT. Forget symbols. A whole number is just a count of identical dots. The number is seven dots. Nothing more.
WHY. Every later argument is about splitting a number. Before we can split, we must picture the thing being split. Dots are the most honest picture — they don't hide any structure.
PICTURE. Look at the figure. On top, dots sit in a single straight line. Below, dots also start as a line. So far they look the same — both are "just a row."

The question that drives this whole page: can these dots be re-arranged into a filled rectangle wider than one dot?
Step 2 — Multiplication is a rectangle, factors are its sides
WHAT. Take dots and try to line them up in a filled rectangle: rows of dots each. If it works with no gaps, then .
WHY. This turns the abstract idea "divides evenly" into something your eyes can check: does the rectangle come out perfectly full, or is there a ragged leftover? A ragged leftover means does not divide .
PICTURE. dots snap neatly into a block — no gaps. That is a factorisation. The two numbers on the sides are its factors.

This is exactly the parent's "you cannot split it into a rectangle wider than 1," drawn out.
Step 3 — The prime has only the flat rectangle (and where 1 stands)
WHAT. Try to force dots into a block with or more rows. Every attempt leaves a ragged last row. Then look at the smallest pile of all — a single dot, .
WHY. This is what "prime" feels like from the inside. It is not a mystical property — it is the plain fact that dots refuse to tile any rectangle except the flat . And the number is a special case we must settle before building anything.
PICTURE. Rows of : last row half-empty. Rows of : last row has one dot. There is no clean block. Only the single line survives. Off to the side sits the lone dot — it has no "second rectangle" and no genuine flat line either.

Step 4 — The key insight: one side of the rectangle is always short
WHAT. Take any composite number and its block . Rename the sides so that is the smaller (or equal) side: (recall from the opening definition — " is not to the right of "). Now watch the shape.
WHY. Testing every possible divisor is slow. If we can prove the short side can never be very long, we only have to check small divisors — and we'll have covered every rectangle automatically. This is the entire reason we care about the shape.
PICTURE. A wide-but-short rectangle: many columns, few rows. Overlay the biggest square that fits (). The square sits inside the rectangle — it cannot poke past it, because the rectangle is at least as wide as it is tall.

Take the square root of both sides (the square root just asks "what side length gives this area?"):
Conclusion of the step: the smaller side of any rectangle is at most . So if there is no divisor , there is no rectangle at all — the number is prime.
Step 5 — Trial division, drawn as a search up to
WHAT. To test whether is prime, try each candidate short side . If none tiles a clean rectangle, is prime.
WHY. Step 4 promised the short side never exceeds . So the search window is guaranteed complete — we cannot miss a factor by stopping there. Going further would only re-find the tall partner of a short side we already tested.
PICTURE. A number line from to . A shaded band covers to — "the only place a short side can live." Everything to the right of is the partner zone; it is checked for free.

This shrinks the work from to — see Time complexity Big-O. For : , so we test only and finish in four checks.
Step 6 — The Sieve: kill whole rectangles at once
WHAT. First, fix a ceiling. Let be the largest number we want to test — we will find every prime from up to this . Now lay out all of and cross off every multiple of , then of , then of , and so on. A crossed number is "some rectangle's area" — a composite. Survivors are prime.
WHY. Trial division re-checks against every number separately. That repeats work. The sieve does the reverse: pick a short side once, and knock out all numbers that have as a factor in a single sweep.
PICTURE. The grid with . The sweep paints all even numbers. Follow the arrow jumping each time: — every one is a rectangle " something."

Step 7 — Why crossing starts at , not
WHAT. When we sweep prime , we begin crossing at , skipping the earlier multiples . Here the multiplier is a whole number ranging over the integers ; the multiple we skip is .
WHY. Every skipped multiple with has a factor smaller than . That means it was already crossed during the earlier sweep of 's smallest prime. The first new victim is (this is with ), where both sides are .
PICTURE. The multiples of : are already faded (killed by , , ). The first fresh cross lands on . The green arrow points at as the true starting gun.

Step 8 — Why we stop when (and what happens to 1)
WHAT. Once the current prime satisfies , we stop sieving. Every number from still standing is declared prime. The lone cell needs a separate ruling — see below.
WHY. By Step 4, every composite has a short side , hence a prime short side . So every composite was crossed during a sweep with some . Once (equivalently ), no un-crossed composite can remain — anything still standing has no short side, so it is prime.
PICTURE. The finished grid. Sieved with only (). Crossed cells are pale; the survivors glow. The cell is shaded a third colour — a reminder it is not a prime even though nothing crossed it. The dashed line marks — the "no need to sieve past here" wall.

The one-picture summary
The final figure is not a restatement — it is the decision tree a computer (or you) actually runs on a single number , with every branch from this page wired in: the window, the start, the stop, and the two special exits for and the primes.

Recall Feynman: tell it back in plain words
Every number is a pile of dots. A dot-pile is composite when the dots snap into a real rectangle — rows and columns both bigger than one. The number is a single dot: it makes no rectangle and no genuine flat line, so it is neither prime nor composite — a special leftover we set aside by hand. Now here is the trick that runs everything: line any rectangle up so its short side is on the left. That short side can never be longer than the number's square root — because if both sides were long, the block would hold more dots than we started with. So to check if a number is prime, I only walk the divisors up to its square root; if none makes a clean rectangle, no rectangle exists and it's prime. The sieve does this for a whole crowd from up to my ceiling : the number shouts "sit down!" to all its multiples, then , then . But each caller starts shouting from its own square , because the smaller multiples (with the counter below ) were already told to sit by smaller callers. And I only need callers up to the square root of — after that, everyone still standing (except the odd-one-out ) could never form a rectangle, so they must be prime.
Connections
- Prime numbers — Sieve of Eratosthenes, primality testing (parent)
- Factorisation
- Divisibility rules
- Modular arithmetic
- Time complexity Big-O
- Fundamental Theorem of Arithmetic
- GCD and LCM