Showing posts with label Copeland-Erdos constant. Show all posts
Showing posts with label Copeland-Erdos constant. Show all posts

Monday, 27 July 2026

Finding Numbers Within The Copeland-Erdos Constant

I watched this video recently about the Copeland-Erdos constant.

There following text was included below the video:

Write the primes in a row — 2, 3, 5, 7, 11, 13, and on forever — put a decimal point in front, and you get a single number: 0.235711131719232931… the Copeland–Erdős constant. In 1946, Copeland and Erdős proved it is normal in base ten: every finite string of digits appears in its expansion, and appears exactly as often as pure chance would predict — each digit one tenth of the time, each pair one hundredth, every block its fair share. So the opening of pi (314159) is in there, at digit 6,903. So is 42, at digit 214. So is every birthday, phone number, and message ever written.

What makes this remarkable: normality is the rule, not the exception — a randomly chosen real number is normal with probability one (Borel, 1909) — yet we still cannot prove that pi, e, or the square root of two are normal. The first explicit example was Champernowne's constant (0.123456789101112…), normal because it was built by pasting in every integer on purpose. The primes do no such favor: they thin out, follow no pattern, and were never designed to be tidy — and their concatenation is normal anyway. This video builds the number, defines normality, shows why the famous constants resist proof, and walks the intuition (via the prime number theorem) for why the patternless primes still even out in the limit.

I was interested in determining if and where a particular number, let's say my diurnal age today, might occur within this constant. Gemini created a program to do this, although I've written similar programs in the past myself for finding numbers within other constants like \( \pi\), \(e\) and \( \sqrt{2}\). Here is a permalink for the Gemini program. I've incorporated this program into my daily number analysis. Here is the output for the number associated with my diurnal age today: 28239.

The position in the Copeland-Erdos constant

Target '28239' first appears at position: 61014

What's of interest is whether a number can be equal to its index. I got Gemini to investigate and here is what it came up with:

While no fixed point where the 1-based index $P(N)$ equals $N$ itself has been found among smaller integers in the Copeland–Erdős constant, number-theoretic density principles dictate that such numbers must exist among larger composite numbers, even though they are mathematically impossible among prime numbers.

To see why this dichotomy exists, we have to look at the growth rate of the string indices for primes versus composite numbers.

Why Primes Never Equal Their Index

For any prime number $p$, its "natural" appearance occurs when $p$ itself is concatenated into the decimal stream. The 1-based index where $p$ begins is equal to $1$ plus the total number of digits of all primes strictly smaller than $p$:

$$P_{\text{natural}}(p) = 1 + \sum_{q < p} \lfloor \log_{10}(q) + 1 \rfloor$$

Using Chebyshev's function $\theta(p) = \sum_{q \le p} \ln(q)$, which by the Prime Number Theorem is asymptotically equivalent to $p$, we can evaluate the sum of the base-10 logarithms of all primes up to $p$:

$$\sum_{q < p} \log_{10}(q) = \frac{1}{\ln 10} \sum_{q < p} \ln(q) \sim \frac{p}{\ln 10} \approx 0.4343 \times p$$

Because $\frac{1}{\ln 10} \approx 0.4343 < 1$, the cumulative number of digits written into the stream grows at less than half the rate of the prime numbers themselves. By the time we concatenate a large prime $p$, its starting position is only around the $0.4343p$ mark. If $p$ happens to appear even earlier as an accidental substring across prime boundaries, its index is smaller still.

Therefore, for all primes, $P(p)$ is strictly less than $p$, making a fixed point $P(p) = p$ impossible.

Why Composites Can Form Fixed Points

Composite numbers behave completely differently because they never get a "natural" turn in the prime concatenation. They can only appear in two ways:

  1. As an accidental boundary string formed across the junction of two or more adjacent primes (for example, 4 first appears at index 21, spanning across the end of $3\mathbf{7}$ and the start of $\mathbf{4}1$).
  2. As a substring entirely within a much larger prime $q > N$.

Because the Copeland–Erdős constant is normal in base 10 (proven by Copeland and Erdős in 1946), every finite decimal string is guaranteed to appear eventually. However, the expected waiting time to see a specific $k$-digit composite string by chance in a normal sequence is roughly $10^k \ln 10 \approx 2.3 \times 10^k$.

Because $N$ itself sits between $10^{k-1}$ and $10^k$, a typical composite number that does not get an early boundary match will appear at an index much larger than $N$.

The Oscillation of $P(N) - N$

We can see this sharp split by examining the first few integers in the constant (OEIS A229190):

Integer $N$ Index $P(N)$ Type Behavior
2 1 Prime $P(N) < N$
3 2 Prime $P(N) < N$
4 21 Composite $P(N) > N$
5 3 Prime $P(N) < N$
6 31 Composite $P(N) > N$
7 4 Prime $P(N) < N$
8 41 Composite $P(N) > N$
9 12 Composite $P(N) > N$
10 47 Composite $P(N) > N$

Notice how consistently the primes lag behind their own values ($P(N) < N$), while the composite numbers overshoot ($P(N) > N$).

As we examine larger numbers, "lucky" composite numbers will occasionally appear unusually early due to boundary concatenations, while "unlucky" ones will appear late. Because the difference function $f(N) = P(N) - N$ oscillates wildly between negative values (for primes and early-matching composites) and large positive values (for late-matching composites), the graph of $P(N)$ repeatedly jumps across the line $Y = N$.

While finding a specific integer where $P(N) = N$ requires extensive string-searching through millions of digits, this continuous crossing confirms that fixed points exist among composite numbers.

Friday, 11 June 2021

Concatenations

Today I turned 26366 days old and yesterday, of course, I was 26365 days old. Each of these numbers have the property that the leading two digits (26) represent the number of fortnights in a year while the final three digits (365 and 366) represents the number of days in non-leap years and a leap years respectively. Incidentally, 26 fortnights represent 26 x 14 = 364 days and so 26364 encodes that fact. Similar pairs of numbers include:

  • 12365 and 12366 where 12 represents the number of months in a calendar year
  • 13365 and 13366 where 13 represents the number of lunar months in a calendar year
  • 52365 and 52366 where 52 represents the number of full weeks in a calendar year
The concatenation of numbers, according to WolframMathWorld, is represented by the symbol \( \parallel \) and thus 26\( \parallel \)366 = 26366. The formula for the concatenation in base \(b\) of two numbers, \(p\) and \(q\), is given by:$$p \parallel q=p \, b^{f(q)} + q \text{ where } f(q)=\left \lfloor \log_b{q} \right \rfloor + 1$$$$ \text{where }f(q) \text{ represents the length of } q$$Let's test this formula out in the case of 26366. We have \(p=26\) and \(q=366\). Clearly the length of \(q\) is 3 but let's check using \( \left \lfloor \log_{10}366 \right \rfloor + 1\). The value of this is indeed 3 so all is good.

When constructing an algorithm, the formula is useful as a way of accomplishing the concatenation without resorting to strings. Figure 1 shows the relevant SageMath code.


Figure 1: permalink

26365 and 26366 have some interesting shared properties. They are both semiprimes and emirpimes :
  • 26365 = 5 * 5273 and 56362 = 2 * 28181
  • 26366 = 2 * 13183 and 66362 = 2 * 33181
In recreational mathematics, there are some interesting applications of concatenation. One of these involves so-called home primes. These are primes obtained by repeatedly factoring the increasing concatenation of prime factors of a given number. I've written about these in an eponymous post on May 2nd 2021. Let's work out the home primes for 26364, 26365 and 26366.

For 26364, we find ten steps are required to reach the home prime: 
 
26364
223131313
792824447
10113956473
21147933443
713589739409
4059117579999
31353039193333
1113305413717887
313175353597790561

For 26365, only six steps are required:

26365
55273
311783
734271
3311787
31764937

For 26366, seven steps are required:

26366
213183
3323687
17195511
35731837
196728069
365576023

The Smarandache–Wellin numbers involve the concatenations of the first prime numbers. These numbers form OEIS A019518:


 A019518

Smarandache-Wellin numbers: a(n) is the concatenation of first n primes (written in base 10).


The sequence begins:

2
23
235
2357
235711
23571113
2357111317
235711131719
23571113171923
2357111317192329
235711131719232931
23571113171923293137
2357111317192329313741
235711131719232931374143
23571113171923293137414347

Of the numbers listed here only 2, 23 and 2357 are prime. The next such number that is prime has 355 digits!

If we concatenate the integers, we create the Champernowne constant, a transcendental real constant whose decimal expansion has important properties. It is named after economist and mathematician D. G. Champernowne, who published it as an undergraduate in 1933. I've written about this constant in an eponymous post on March 22nd 2019. The constant begins 12345678910111213141516 ... 

The Copeland–Erdős constant is formed by the concatenation of "0." with the base 10 representations of the prime numbers in order. Its value, using the modern definition of prime, is approximately 0.235711131719232931374143…

There is a reverse integer sequence that comprises OEIS A000422:


 A000422

Concatenation of numbers from n down to 1.             


The sequence begins:

1
21
321
4321
54321
654321
7654321
87654321
987654321
10987654321
1110987654321
121110987654321
13121110987654321
1413121110987654321
151413121110987654321
16151413121110987654321
1716151413121110987654321
181716151413121110987654321

Interestingly, this sequence produces very few primes with the first being when \(n=82\) and the next being \(n=37765\).

We can concatenate the odd, even, triangular, square, cubic and Fibonacci numbers and all of these have associated OEIS sequences. Follow this link for more information.