Plot · Running sums

Primes lead early, then lose forever.

March up the whole numbers and keep two totals: everything prime goes in one pile, everything non-prime (1 and the composites) in the other. At the very start the primes are ahead — but the composites pile up faster and faster, and after one early crossover the primes never lead again. Watch where the flip happens, and how small the primes' share of the total eventually gets.

up to 50up to 200up to 1,000up to 10,000up to 100,000
Σ primes Σ non-primes (1 & composites) last point primes led
n = 200 · Σprimes = 4,227 · Σnon-primes = 15,873 · prime share = 21.03% · non-primes ahead  (hover the plot to inspect any n)
Walk the whole numbers 1, 2, 3, … and keep two piggy banks: every time you hit a prime you add it to the gold total, every time you hit a non-prime (1 and the composites) you add it to the blue total. For the first few steps the primes actually lead — 2, 3, 5, 7 arrive fast and there aren't many composites yet. But primes thin out (the count below n grows like n/ln n), so the blue total pulls ahead and never gives the lead back. The red line marks the last moment the primes were ahead: n = 7 in this range. Switch to prime share to watch that fraction fall toward zero like 1 / ln n — the running sum of the primes becomes a vanishing sliver of everything.

The primes stay ahead only through n = 7; from 8 onward the non-prime total is permanently in front. That's the prime number theorem showing up as arithmetic: the count of primes below n grows like n / ln n, so their sum is about n² / (2 ln n) against n² / 2 for all the numbers — a share that slides toward zero as 1 / ln n. Compare with differences and the comet.