Polyhedra, graphs and number theory

VectorPaint sieving up to thirty: retain each prime while removing its multiples

Track rounds for two, three and five in a fixed two-to-thirty grid, distinguishing first removals, revisits and the ten final primes.

English translation of the Chinese original, translated on . Original publication dates, attribution, code and version notes are retained.

Use a static number grid to illustrate the sieve of Eratosthenes. Retain each current prime and distinguish revisiting an already removed number from removing it again. Keep manual algorithm records separate from VectorPaint layout; no built-in prime calculator is implied.

Build a unique grid from two through thirty

Create a 1600×1200 canvas with six columns and five rows. Row one is 2..7, row two 8..13, continuing to a final row 26..30 with its last cell labelled outside scope. There are twenty-nine integers from 2 through 30, so thirty cells do not justify adding 1 or 31. Separate numbers, removal marks, retention circles and round notes. Fix positions across rounds. The grid organises reading; integer conditions, rather than colour or cell location, determine the algorithm.

Read the sieve rule and exclude one

The NIST sieve entry starts with unmarked integers from 2 and processes multiples of successive unmarked numbers. A prime is greater than 1 with only 1 and itself as positive divisors, so 1 is neither in this grid nor a missed surviving prime. Declare inclusive upper bound 30 and lower bound 2. Clarify removal as larger multiples after the prime, or starting at its square; beginning at one times the prime would wrongly remove the prime itself.

Retain two and remove fourteen even composites

Circle 2 and remove 4,6,8,10,12,14,16,18,20,22,24,26,28,30: fourteen cells. Match each ledger value to its cell instead of colouring alternating positions, since row wrapping changes visual patterns. Four is 2², a valid starting point; 2×1 is the prime and stays. Retain a first-round-only copy so the fourteen first removals remain recoverable after later overlays rather than leaving only a final field of crosses.

Retain three and distinguish new from repeated removals

The next unmarked integer is 3. Retain it and visit 9,12,15,18,21,24,27,30 from 3² upward. The visits to 12,18,24,30 overlap earlier multiples: specifically, the prime-two round already removed them. Only 9,15,21,27 are newly removed, four cells. Six is also a larger multiple of 3, but starting at 3² does not miss it because 2 already handled it. Use a distinct round style and separate first-removal dots so eight visits are not counted as eight new composites.

Retain five and newly remove only twenty-five

Four is already removed and cannot start a new prime round. The next unmarked value is 5. Retain it and visit 25 and 30 from 5² within the bound; 30 is old, so only 25 is new. Smaller multiples 10,15,20 were handled by 2 or 3. Label 25=5×5: being odd and not divisible by 3 does not justify survival. Check that the retained 5 was not accidentally included in a deletion region with 25. Retention and removal marks must remain distinct.

Explain stopping with the square bound

Since √30 lies between 5 and 6, after processing 5 the next unmarked 7 has square 49 beyond the bound, so main sieving stops. Any composite at most 30 must have a factor at most √30; otherwise both factors would multiply to more than 30. Its smaller prime factor is therefore already among 2,3,5. Seven remains prime but needs no marking round. Record this mathematical stop condition rather than stopping for page space or visual confidence; √30 is not 30/2.

Audit ten survivors and nineteen removed values

Survivors are 2,3,5,7,11,13,17,19,23,29: ten primes. New removals total 14+4+1=19; 10+19=29 matches the original grid size. Nine survivors suggests accidental removal of 2 or 5; eleven suggests a missed 25. Sort only a separate result list and keep the grid fixed so round evidence remains traceable. Removed values are not all nonprimes without qualification: 1, zero and negatives are outside this diagram’s range.

Reopen and recalculate all three rounds

Save, leave and reopen. Hide final answers, audit fourteen first-round removals, then four new removals in the prime-three round and finally 25 in the prime-five overlay. Processing prime 5 completes the third round; check the total is three. Reconstruct all ten survivors and the stopping condition 7²>30. Inspect numbers versus crosses and the out-of-scope empty cell in output, leaving untested formats unverified. Another reader should reproduce each round and count without inferring an automatic prime table or unlimited-range verification.

Related tutorials and sources

VectorPaint factor trees for seventy-two: retain repeated primes and the leaf product, VectorPaint order-four Latin squares: check one to four in every row and column.

Checked on November 14, 2026: VectorPaint public version 1.0.8, requiring iOS / iPadOS 17.0 or later. Scope follows the official App Store and Apple public lookup. Manual exercises use controls actually available in your installed version; external calculations, written records and diagrams imply no built-in automatic analysis. No step-by-step physical-device, private-file or all-export-environment testing is claimed.