Monday, 18 May 2026

Base 10 Primes in Higher Number Bases

The thought struck me as to what primes in base 10 remain prime when the digits stay the same but the number base increases to 11, 12, 13 etc. I got Gemini to investigate and it came up with useful summary and an impressive interactive tool for investigation:

To analyze this integer sequence mathematically, we can define the transformation as evaluating a polynomial.

Let a base-10 prime \( p \) have the decimal representation \( d_k d_{k-1} \dots d_1 d_0 \). The value of \( p \) is given by:

\[ p = \sum_{i=0}^{k} d_i 10^i \]

When we take these same digits and interpret them in a higher base \( b \) (where \( 11 \le b \le 36 \)), we are evaluating the new integer \( P_b \):

\[ P_b = \sum_{i=0}^{k} d_i b^i \]

The task is to find all instances where both \( p \) and \( P_b \) are prime. When we run this analysis across different bases, distinct number-theoretic patterns emerge, particularly regarding parity and divisibility.

The Parity Sieve for Odd Bases

The parity of the new number \( P_b \) depends entirely on whether the target base \( b \) is odd or even.

If the target base \( b \) is odd (e.g., base 11, 13, 15), then \( b \equiv 1 \pmod 2 \). Consequently, the modulo-2 value of the new number collapses to the sum of its digits:

\[ P_b \equiv \sum_{i=0}^{k} d_i \pmod 2 \]

This creates a massive sieve: if the sum of the digits of the original prime \( p \) is even, \( P_b \) will inevitably be even. Since \( P_b > 2 \) for all target primes in these higher bases, an even \( P_b \) is strictly composite. Therefore, odd bases yield a significantly sparser sequence of primes.

The Density in Even Bases

If the target base \( b \) is even (like the default \( b=16 \)), then \( b \equiv 0 \pmod 2 \). In this scenario, all terms multiplied by \( b \) are even, meaning the parity of \( P_b \) relies solely on the final digit \( d_0 \):

\[ P_b \equiv d_0 \pmod 2 \]

Because \( p \) is prime in base-10, its final digit \( d_0 \) must be odd (1, 3, 7, or 9) with the sole exception of \( p=2 \). Therefore, \( P_b \) will always be odd in an even base. Because they bypass the digit-sum parity trap, even bases like 16 retain a much higher density of prime numbers.

Small Examples in Base 16

For \( b=16 \), examining the first few base-10 primes reveals the retention rate:

  • 11: \( 1(16) + 1 = 17 \) (Prime)
  • 13: \( 1(16) + 3 = 19 \) (Prime)
  • 17: \( 1(16) + 7 = 23 \) (Prime)
  • 19: \( 1(16) + 9 = 25 \) (Composite, \( 5 \times 5 \))
  • 23: \( 2(16) + 3 = 35 \) (Composite, \( 5 \times 7 \))
  • 29: \( 2(16) + 9 = 41 \) (Prime)

To thoroughly investigate the sequence up to 40,000 across any base from 11 to 36 without relying on a static, truncated list, the interactive tool below is designed to compute the results dynamically. It handles the base conversions and primality testing locally within your browser.

Total Primes Found: 0
Index Base 10 Prime Value in Target Base

No comments:

Post a Comment