Showing posts with label composites. Show all posts
Showing posts with label composites. 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.

Sunday, 6 November 2022

Reversible Twin Prime Composites

What do I mean by a twin prime composite? Well, every twin prime pair has a composite number in between and that's the composite number I'm referring to. For example, 41 and 43 form a twin prime pair and 42 is the composite number in between. What's not so common though is a reversible twin prime composite meaning that when the composite is reversed, it's still wedged between two adjacent primes.

Now 42 fails in this regard because its reversal is 24 and while 23 is prime, 25 is not. However, 60 qualifies because its wedged between the primes 59 and 61 and, when it's reversed to form 6, it is still between two primes (5 and 7). Such numbers form OEIS sequence A103741:


 A103741

Non-palindromic composites located between twin primes whose reverses, which are smaller, are also located between twin primes.



Here the condition that the reversed composite must be smaller than the original is imposed. The sequence up to one million is:

60, 240, 270, 600, 810, 822, 2130, 2340, 2802, 8010, 8220, 8430, 8838, 8862, 20550, 22740, 23202, 23370, 23910, 25410, 26880, 27240, 28410, 28572, 28662, 29022, 29760, 80472, 81702, 81930, 81972, 82140, 82530, 83220, 83340, 83640, 85620, 87222, 88470, 203430, 203460, 207240, 208590, 213360, 217200, 218970, 220020, 221070, 224910, 226902, 228300, 230940, 232080, 233160, 233550, 233940, 235440, 238080, 241260, 241512, 243432, 243702, 245130, 245910, 246510, 250050, 250950, 251970, 253680, 255180, 256722, 259122, 259620, 262050, 262152, 263610, 265542, 267390, 267960, 269220, 269430, 270240, 272010, 272760, 278562, 279552, 280410, 281250, 282240, 282390, 286542, 289020, 289140, 292710, 295200, 296730, 296970, 801000, 801420, 802650, 803730, 804282, 806370, 806382, 806790, 808020, 812760, 814062, 815412, 818580, 819618, 820320, 820680, 821208, 822762, 823830, 827130, 829728, 831540, 833712, 834150, 835320, 838092, 840180, 841020, 841080, 846060, 846360, 848790, 848922, 849600, 853902, 856548, 860010, 861492, 862482, 862650, 864300, 864630, 865638, 872658, 872748, 875340, 875418, 875520, 875760, 877110, 878022, 878832, 879168, 879582, 880068, 880248, 880800, 883410, 885552, 887400, 887658, 888060, 888870, 889878, 891000, 893340, 894450, 895650, 895800, 898482, 898662

There are only 168 such numbers in the range up to one million. Notice the big jumps shown in bold. The sequence jumps in a consistent manner:
  • 2802 to 8010
  • 8862 to 20550
  • 29760 to 80472
  • 88470 to 203430
  • 296970 to 801000
This is best seen graphically. See Figure 1. 


Figure 1: permalink

Why such big gaps? Apart from 60, all numbers start with 2 (and end in 0 or 2) or they start with 8 (and end in 0, 2 or 8). We know that the reverse of the number must be smaller and this means that whatever digit the number starts with, the final digit must be equal to or smaller than it. This immediately rules out a number like 2093. However, why are there no numbers starting with 1, 3, 4, 5, 6, 7 or 9?

The initial composite numbers must be even as they lie between two primes so that rules out numbers whose final digits are 1, 3, 5, 7 or 9. Only composites ending in 0, 2, 4 or 8 are possible. Its reverse must also end in 0, 2, 4 or 8 if it is to lie between twin primes. If a number starts with 2 then it must end in 0 or 2. If a number starts with 4 it must end in 0, 2 or 4. If a number ends in 8 then it must end in 0, 2, 4 or 8. So why are there no numbers starting with or ending in 4? If a number starts with 4, then its reversal will end in a 4 and therefore the number above it (except for 5) cannot be prime because it ends in a 5. 

Figure 2 shows a table of the initial composites and associated primes together with the reversed composites and their associated primes.


Figure 2: permalink

Saturday, 26 February 2022

Another Prime Generating Polynomial

 I've posted about prime generating polynomials before, specifically:

In that first post, I included a table taken from MathWorld of the most impressive prime producing polynomials (not necessarily linear or quadratic). See Figure 1.


Figure 1

However, in that table, there's no mention of the fairly impressive prime producing polynomial that generates the sequence of number for OEIS A218456:


 A218456

\(2n^3 - 313n^2 + 6823n - 13633\)                                                                         

In the range of values for \(n\) from -8 to 102, it produces 90 primes out of the 110 numbers constituting an impressive 81.8% of the range. My attention was drawn to this polynomial because the number associated with my diurnal age today (26627) is a prime and a member of this sequence (when \(n\)=12). 

The initial members are:

-13633, -7121, -1223, 4073, 8779, 12907, 16469, 19477, 21943, 23879, 25297, 26209, 26627, 26563, 26029, 25037, 23599, 21727, 19433, 16729, 13627, 10139, 6277, 2053, -2521, -7433, -12671, -18223, -24077, -30221, -36643, -43331, -50273, -57457

Notice that some values are negative so we are considering absolute values here and ignoring the sign. The members of the sequence can be prime or composite. Figure 2 shows a plot of the prime values of the polynomial in the range from -8 to 102. I've chosen this range because values of -9 and 103 produce composite numbers.


Figure 2

The minimum prime produced in the range is 1223 and the maximum is 477551. The polynomial is cubic and Figure 3 shows what it looks like (courtesy of GeoGebra) and it can be seen that most of the values in the range are negative.


Figure 3

However, given that we are  only interested in positive values then the graph of \(y=|2n^3 - 313n^2 + 6823n - 13633|\) is as shown in Figure 4 and reflects what is shown in Figure 1.


Figure 4

Interestingly, 26627 is also a member of another sequence produced by a prime generating polynomial viz. OEIS 
A320772:


 A320772

Prime generating polynomial: a(\(n\)) = \( (4n - 29)^2 + 58\)                              


The initial members of the sequence are:

683, 499, 347, 227, 139, 83, 59, 67, 107, 179, 283, 419, 587, 787, 1019, 1283, 1579, 1907, 2267, 2659, 3083, 3539, 4027, 4547, 5099, 5683, 6299, 6947, 7627, 8339, 9083, 9859, 10667, 11507, 12379, 13283, 14219, 15187, 16187, 17219, 18283, 19379, 20507, 21667, 22859, 24083, 25339, 26627, 27947

This quadratic polynomial generates 28 distinct primes in succession from \(n\)=1 to 28. 26627 is generated by \(n\)=28. This polynomial is not listed in the table shown in Figure 1. The minimum prime is 59 and maximum is 6947. The graph of the quadratic lies completely above the \(x\) axis so all values generated are positive.

Figure 5 shows the numbers that are generated in the range from -8 to 102 (the same range as for the previous cubic polynomial). As the values exceed 28, it can be seen that the number of primes generated decreases. Overall, the density of primes in the range is 65.5% or 72 out of 110.                        


Figure 5

Saturday, 24 April 2021

Riesel and Sierpinski Numbers

In mathematics, a Riesel number is an odd natural number \(k\) for which \(k \times 2^n-1 \) is composite for all natural numbers \(n\). This is sequence A101036 in the OEIS. I have encountered numbers of this form before but in a different context. In a post of June 27th 2016, I wrote about Proth-like numbers that are also of the form \(k \times 2^n-1 \) and that are prime for certain values of \(k\) and \(n\). Some of these prime-producing combinations of \(k\) and \(n\) are listed on this website: 

http://www.prothsearch.com/riesel2.html

Figure 1 shows a screenshot from the opening page.


Figure 1

For example, if \(k=121\), then the initial values of \(n\) that produce primes are as follows:
1, 3, 21, 27, 37, 43, 91, 117, 141, 163, 373, 421, 1581, 2035, 10701, 18931, 21307, 51195, 64579, 156541, 302097, 334257, 368059, 383061, 410131, 494317, 541621, 990219, ...
The reason that I referred to these sorts of numbers as Proth-like is that the actual Proth numbers are of the form \(k \times 2^n+1 \) and the primes that are produced by suitable combinations of \(k\) and \(n\) are referred to as Proth primes.

Hans Ivar Riesel: biography

Riesel numbers are clearly the opposite because we are only interested in values of \(k\) that always produce composite numbers, no matter what the value of \(n\). It should be noted that a Riesel number does not refer to the prime itself but to the coefficient of \(2^n\). The currently known Riesel numbers are shown below and constitute OEIS A101036:
509203, 762701, 777149, 790841, 992077, 1106681, 1247173, 1254341, 1330207, 1330319, 1715053, 1730653, 1730681, 1744117, 1830187, 1976473, 2136283, 2251349, 2313487, 2344211, 2554843, 2924861, ...

To quote from Wikipedia:

In 1956, Hans Riesel showed that there are an infinite number of integers \(k\) such that \(k\times 2^n-1 \) is not prime for any integer \(n\). He showed that the number 509203 has this property, as does 509203 plus any positive integer multiple of 11184810. The Riesel problem consists in determining the smallest Riesel number. Because no covering set has been found for any \(k\) less than 509203, it is conjectured to be the smallest Riesel number.

To check if there are \(k < 509203\), the Riesel Sieve project (analogous to Seventeen or Bust for Sierpinski numbers) started with 101 candidate \(k\). As of January 2021, 53 of these \(k\) had been eliminated by Riesel Sieve, PrimeGrid, or outside persons. The remaining 48 values of \(k\) that have yielded only composite numbers for all values of \(n\) so far tested are

2293, 9221, 23669, 31859, 38473, 46663, 67117, 74699, 81041, 93839, 97139, 107347, 121889, 129007, 143047, 161669, 192971, 206039, 206231, 215443, 226153, 234343, 245561, 250027, 315929, 319511, 324011, 325123, 327671, 336839, 342847, 344759, 362609, 363343, 364903, 365159, 368411, 371893, 384539, 386801, 397027, 409753, 444637, 470173, 474491, 477583, 485557, 494743

The most recent elimination was in November 2020, when \(146561 × 2^{11280802} − 1 \) was found to be prime by PrimeGrid. This number is 3,395,865 digits long. As of January 2021, PrimeGrid has searched the remaining candidates up to \(n = 11,300,000\). 

There is also the notion of the covering set in relation to Riesel numbers. To quote again from Wikipedia:

A number can be shown to be a Riesel number by exhibiting a covering set: a set of prime numbers that will divide any member of the sequence, so called because it is said to "cover" that sequence. The only proven Riesel numbers below one million have covering sets as follows:

  • \(509203\times 2^n-1\) has covering set {3, 5, 7, 13, 17, 241}
  • \(762701\times 2^n-1\) has covering set {3, 5, 7, 13, 17, 241}
  • \(777149\times 2^n-1\) has covering set {3, 5, 7, 13, 19, 37, 73}
  • \(790841\times 2^n-1\) has covering set {3, 5, 7, 13, 19, 37, 73}
  • \(992077\times 2^n-1\) has covering set {3, 5, 7, 13, 17, 241}

The concept of Riesel numbers can be extended to bases other than 10 but I won't go into that here. Instead let's consider what constitutes a Sierpinski number. Wikipedia provides this definition:

In number theory, a Sierpiński number is an odd natural number \(k\) such that \( k \times 2^n+1\) is composite for all natural numbers \(n\). In 1960, Wacław Sierpiński proved that there are infinitely many odd integers \(k\) which have this property.


Wacław Sierpiński: biography

The article continues by saying that:

The sequence of currently known Sierpiński numbers constitutes OEIS A076336 begins with:

78557, 271129, 271577, 322523, 327739, 482719, 575041, 603713, 903983, 934909, 965431, 1259779, 1290677, 1518781, 1624097, 1639459, 1777613, 2131043, 2131099, 2191531, 2510177, 2541601, 2576089, 2931767, 2931991, ... 

The number 78557 was proved to be a Sierpiński number by John Selfridge in 1962, who showed that all numbers of the form \(78557 \times 2^n + 1\) have a factor in the covering set {3, 5, 7, 13, 19, 37, 73}. For another known Sierpiński number, 271129, the covering set is {3, 5, 7, 13, 17, 241}. Most currently known Sierpiński numbers possess similar covering sets. 

A number may be simultaneously Sierpiński and Riesel. These are called Brier numbers and constitute OEIS A076335. The smallest five known examples are: 

  • 3316923598096294713661
  • 10439679896374780276373
  • 11615103277955704975673
  • 12607110588854501953787
  • 17855036657007596110949
There's a lot more that could be said but I'll leave it there as the essential ideas have been covered.