Prime Race

Divide an odd prime by 4 and the remainder is 1 or 3. Which team finds more primes as you count upward? Follow the lead and see how long it takes to change sides.

Lead by checkpoint

4k + 3 4k + 1 Tie

Checkpoint x
—
π(x; 4, 3)
—
π(x; 4, 1)
—
Leader and margin
—

Map of the lead

Each tile spans a short interval. Its colors show the share of integer checkpoints led by each team or tied. Select a tile or use the arrow keys to explore.

  • 4k + 3—
  • 4k + 1—
  • Tie—

What do the squares change?

Every odd prime square leaves remainder 1 when divided by 4. Give team 4k + 1 half a point for every such square up to x. The dashed line keeps the original score in view.

D(x) = π(x; 4, 3) − π(x; 4, 1)
D½(x) = D(x) − ½ · (π(√x) − 𝟙x ≥ 4)

Mathematics and sources

The sieve counts the odd primes and their squares up to each displayed checkpoint. The prime 2 belongs to neither team. The percentages in the map describe finite intervals of integer checkpoints. Chebyshev’s bias is also studied using logarithmic density, which gives more weight to smaller checkpoints.

Rubinstein & Sarnak, Chebyshev’s Bias (1994) · Calculation code