Primearium Lab · Number Systems
Primes in Strange Number Systems
Switch the number system and watch the exact same primes morph into fresh visual textures — from alternating negabinary staircases to golden-ratio waves and the eight locked jewel lanes of base 30.
Layer 2 · Understand
Why does this barcode look the way it does?
Four strange bases, one hidden clock
When you morph between Base 30, Base 31, Base −29, and Base 29, the digits completely scramble — yet the mod 30 strip on the right never changes a single pixel. Here is why for the currently inspected prime (click any row to morph):
Because 31 ≡ +1, −29 ≡ +1, and 29 ≡ −1 (mod 30), all four rules are disguises for the exact same arithmetic check: is the number divisible by 2, 3, or 5?
Layer 3 · Live Experiment
Honest check: what actually predicts primality?
Strange number systems create mesmerizing visual textures, so it is tempting to look for secret prime clues in their digits. Here is a live test run directly in your browser on all integers from 7 up to N.
Residue fingerprint of primes
Live predictive-lift scorecard
Lift = (prime density in the best bucket) ÷ (overall prime density). A lift of 1.00× means the feature predicts nothing at all; 3.75× = 30/8 is the exact sieve gain of ruling out multiples of 2, 3, and 5.
| Digit feature | Split among primes | Predictive lift | Why? (Status) |
|---|
Layer 3 · Interactive Converter
The Prime Rosetta Stone
Type any integer — prime or composite, even huge powers like 2^61−1 — and compare its visual barcode and exact expansion across all eight strange systems at once.
Layer 4 · Research
For mathematicians
Open exact statements, proofs, conjectures & references
Congruence-preserving digit sums
b ≡ +1 (mod m) ⇒ Σ d_k ≡ n (mod m) | b ≡ −1 (mod m) ⇒ Σ (−1)^k d_k ≡ n (mod m)
For any integer base b (positive or negative) with unique finite expansion n = Σ d_k b^k, reducing modulo m gives n ≡ Σ d_k (b mod m)^k (mod m). Hence b = 31 and b = −29 both satisfy b ≡ +1 (mod 30), making the ordinary digit sum preserve n mod 30; b = 29 satisfies 29 ≡ −1 (mod 30), making the alternating sum preserve n mod 30. The same identity explains why negabinary weight obeys w_{−2}(n) ≡ n (mod 3) and balanced ternary non-zero count obeys nz_3(n) ≡ n (mod 2).
Dirichlet's theorem & the 3.75× sieve ceiling
π(x; 30, a) ~ π(x) / φ(30) = π(x) / 8 (gcd(a, 30) = 1)
By Dirichlet's theorem on primes in arithmetic progressions (1837), primes distribute asymptotically uniformly across the φ(30) = 8 residue classes coprime to 30, each receiving 12.5% of primes. Conditioning on gcd(n, 30) = 1 multiplies prime density by 30 / φ(30) = 3.75 — identically whether detected via base-30 last digit, base-31 or base-(−29) digit sum, base-29 alternating sum, or the last four factorial digits.
Equidistribution of prime digit sums (Mauduit–Rivat, 2010)
gcd(m, q − 1) = 1 ⇒ #{p ≤ x : s_q(p) ≡ a (mod m)} ~ π(x) / m
Solving Gelfond's 1968 problem, Mauduit and Rivat proved in Annals of Mathematics that the base-q sum of digits of primes is equidistributed modulo m whenever gcd(m, q − 1) = 1. In particular, binary (Thue–Morse) popcount parity has zero bias on primes; subsequent work by Drmota, Mauduit, Rivat, and Spiegelhofer extends equidistribution to negative bases and digital expansions.
Zeckendorf sum of digits of primes (Drmota–Müllner–Spiegelhofer, 2022)
#{p ≤ x : s_Z(p) ≡ 0 (mod 2)} ~ ½ π(x)
Even in the non-positional Fibonacci (Zeckendorf) representation — where F_k mod 2 is periodic with period 3 — the number of Fibonacci summands of a prime is proven to be asymptotically 50% even and 50% odd, confirming zero primality signal from Zeckendorf weight parity.
Factorial base & primorial survival
n ≡ Σ_{j=1}^k d_j · j! (mod (k+1)!), φ((k+1)!)/(k+1)! = Π_{q ≤ k+1} (1 − 1/q)
In factoradic notation (OEIS A007623), the trailing k digits determine n mod (k+1)!. Because every prime q ≤ k+1 divides (k+1)!, primality for p > k+1 restricts the tail to φ((k+1)!) allowed patterns: k=1 fixes d₁ = 1 (2×), k=2 forces d₂ ∈ {0, 2} (3×), k=4 encodes mod 120 (which refines mod 30, 3.75×), and k=6 encodes mod 5040 (4.375×).
What remains open?
While James Maynard (2019, Inventiones Mathematicae) proved there are infinitely many primes omitting any single decimal digit (Proven), analogous digit-restriction questions in small bases remain wide open — for instance, whether infinitely many primes exist in base 2 with a bounded number of zeros (Mersenne primes: Conjecture) or in Zeckendorf representation with very few Fibonacci terms (Fibonacci primes: Conjecture). Fine bias effects such as Chebyshev's bias among mod-30 classes depend on the Generalized Riemann Hypothesis (now proven formally, Lean, Nov 2026) together with a further assumption about the zeros that is still unproven (Conjecture).
References & OEIS
- C. Mauduit & J. Rivat (2010), "Sur un problème de Gelfond: la somme des chiffres des nombres premiers", Annals of Mathematics 171(3), 1591–1646.
- M. Drmota, C. Müllner & L. Spiegelhofer (2022), "Primes as sums of Fibonacci numbers", Journal of the European Mathematical Society (arXiv:2102.07859).
- J. Maynard (2019), "Primes with restricted digits", Inventiones Mathematicae 217, 127–218.
- D. E. Knuth (1997), The Art of Computer Programming, Vol. 2 §4.1 (Positional Number Systems: negabinary, balanced ternary, factorial base).
- OEIS: A039724 (base −2), A117966 (balanced ternary), A014417 (Zeckendorf representation), A007623 (factorial base), A007775 (numbers coprime to 30).