Showing posts with label quadruplets. Show all posts
Showing posts with label quadruplets. Show all posts

Thursday, 9 July 2026

More On The RDIV Algorithm

Under the RDIV or Recurring Digital Invariant Variant (a weird name I know) Algorithm, all numbers that are not narcissistic will enter a loop or terminate in a narcissistic number. I was interested in the proportion of numbers that terminate in a narcissistic number and so I had Gemini create an algorithm (permalink) to determine this. In the range up to 40000, there are 12224 such numbers which account for 30.56% of the range. These include the few numbers that are narcissistic themselves namely 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,153, 370, 371, 407, 1634, 8208 and 9474 within the range. 

Here is a fuller list of narcissistic numbers (OEIS A005188):

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474, 54748, 92727, 93084, 548834, 1741725, 4210818, 9800817, 9926315, 24678050, 24678051, 88593477, 146511208, 472335975, 534494836, 912985153, 4679307774, 32164049650, 32164049651, 40028394225, 42678290603

While 12224 numbers are far too numerous to list here, we can thin the numbers by considering only triplets - meaning groups of three consecutive numbers that all lead to narcissistic numbers. Take for example, the numbers 28220, 28221 and 28222. Let's look at  their trajectories under the RDIV algorithm (permalink for generation). It will be seen that all three terminate in narcissistic numbers.

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 28220
==================================================
Full Trajectory Visited:
28220, 32864, 41843, 35060, 11144, 2051, 642, 288, 
1032, 98, 145, 190, 730, 370
Loop Entry Point: 370 (encountered at step 14) Pre-period Length: 13 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 370

================================================== RDIV TRAJECTORY ANALYSIS FOR INPUT: 28221 ================================================== Full Trajectory Visited: 28221, 32865, 43944, 62364, 16851, 43671, 25851,
39051, 62418, 41601, 8802, 8208 Loop Entry Point: 8208 (encountered at step 12) Pre-period Length: 11 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 8208 ==================================================

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 28222
==================================================
Full Trajectory Visited:
28222, 32896, 99868, 191410, 535540, 51700, 19933, 118585,
555540, 66596, 85502, 39050, 62417, 25640, 11957, 78983,
141635, 67108, 57352, 23332, 793, 1099, 13123, 520, 133,
55, 50, 25, 29, 85, 89, 145, 190, 730, 370
Loop Entry Point: 370 (encountered at step 35) Pre-period Length: 34 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 370 ==================================================

In the range up to 40000 there are 1786 such triplets and if we restrict the range to those above 28000, there are only 220 triplets. The central members of each triplet are listed below:

28134, 28221, 28314, 28365, 28563, 28635, 28653, 29121, 29211, 29278, 29728, 29729, 29792, 29972, 30006, 30051, 30055, 30060, 30061, 30151, 30160, 30221, 30222, 30223, 30224, 30233, 30234, 30242, 30249, 30250, 30251, 30252, 30280, 30323, 30324, 30343, 30422, 30433, 30501, 30505, 30510, 30511, 30520, 30521, 30522, 30561, 30601, 30610, 30651, 30820, 31051, 31060, 31111, 31112, 31113, 31114, 31115, 31132, 31133, 31142, 31143, 31284, 31312, 31313, 31412, 31413, 31474, 31475, 31501, 31510, 31744, 31745, 31824, 31839, 32021, 32022, 32023, 32024, 32033, 32034, 32042, 32049, 32050, 32051, 32052, 32080, 32184, 32200, 32201, 32202, 32203, 32204, 32221, 32246, 32254, 32303, 32304, 32402, 32409, 32410, 32426, 32453, 32501, 32502, 32519, 32524, 32529, 32543, 32649, 32685, 32800, 32814, 32865, 33023, 33024, 33043, 33112, 33113, 33199, 33203, 33204, 33310, 33332, 33403, 33556, 33564, 33573, 33574, 33654, 33753, 33754, 34022, 34033, 34112, 34113, 34174, 34175, 34202, 34209, 34210, 34226, 34253, 34303, 34470, 34482, 34523, 34629, 34714, 34715, 34809, 34842, 35001, 35005, 35010, 35011, 35020, 35021, 35022, 35061, 35101, 35110, 35201, 35202, 35219, 35224, 35229, 35243, 35356, 35364, 35373, 35374, 35423, 35500, 35536, 35557, 35558, 35564, 35565, 35601, 35634, 35654, 35655, 35733, 35734, 36001, 36010, 36051, 36249, 36285, 36354, 36429, 36501, 36534, 36554, 36555, 36740, 36825, 37144, 37145, 37353, 37354, 37414, 37415, 37533, 37534, 37640, 37898, 37988, 38020, 38124, 38139, 38214, 38265, 38409, 38442, 38625, 38798, 38978, 39788, 39878

What if we look for quadruplets of such numbers, that is four consecutive numbers such that each of them leads to a narcissistic number under the RDIV algorithm. There are 843 such quadruplets. Let's consider 29727, 29728, 29729 and 29730 (permalink for generation):

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29727
==================================================
Full Trajectory Visited:
29727, 92727

Loop Entry Point:   92727 (encountered at step 2)
Pre-period Length:  1 step(s) before entering cycle
Cycle Length:       1 distinct number(s) in the loop
Canonical Cycle:    92727
==================================================

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29728
==================================================
Full Trajectory Visited:
29728, 108688, 833089, 1057187, 3822365, 2459843, 
6993329, 14633345, 2220997, 10389865, 78677956,
80868197, 100822787, 349143695, 787435454, 219637307,
478245278, 351621107, 52404626, 3881441, 4229261,
5079674, 6804500, 2471597, 6524693, 5439665, 5517662,
1539794, 10486178, 41064387, 24359267, 50954372,
49665125, 47252996, 93994532, 129609702, 825273306,
186642546, 166928742, 582410385, 272624046, 61034823,
18535747, 29160166, 48085827, 56552866, 22988195,
120039012, 387441198, 696753525, 453809058, 660044022,
20680704, 24287425, 23064482, 18594977, 114856422,
146773863, 235381845, 272643729, 478488762, 493962894,
1307101374, 566117175, 104768859, 708502518, 312695826,
543767442, 93544662, 46934467, 52373923, 49222342,
43185378, 39788517, 88527942, 82822627, 40999873,
151754277, 125229729, 817149759, 991981191, 1683899688,
11389527500, 42046156391, 32164049651 Loop Entry Point: 32164049651 (encountered at step 85) Pre-period Length: 84 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 32164049651 ==================================================

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29729
==================================================
Full Trajectory Visited:
29729, 134969, 1114364, 314894, 802507, 395482, 814099, 
1329123, 4787601, 4040559, 4971987, 13326561, 3763237,
1933711, 5610889, 9335335, 4947967, 11525728, 23323781,
22562213, 2077827, 4568037, 3297327, 6434685, 2770104,
1663599, 10206123, 1686691, 7719931, 11215213, 397702,
767532, 298372, 912091, 1062948, 7176570, 2828691,
9257466, 6261021, 560130, 63011, 8021, 4113, 339,
783, 882, 1032, 98, 145, 190, 730, 370 Loop Entry Point: 370 (encountered at step 52) Pre-period Length: 51 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 370 ==================================================
==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29730
==================================================
Full Trajectory Visited:
29730, 76131, 24828, 66624, 24384, 35091, 62418, 41601, 
8802, 8208 Loop Entry Point: 8208 (encountered at step 10) Pre-period Length: 9 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 8208 ==================================================

Because there are four consecutive numbers, only the first and smallest will be listed and so in this case the number would be 29727. In the range between 28000 and 40000, here are the 60 initial or smallest members of each quadruplet:

29727, 30059, 30220, 30221, 30222, 30232, 30248, 30249, 30250, 30322, 30509, 30519, 30520, 31110, 31111, 31112, 31113, 31131, 31141, 31311, 31411, 31473, 31743, 32020, 32021, 32022, 32032, 32048, 32049, 32050, 32199, 32200, 32201, 32202, 32302, 32408, 32500, 33022, 33111, 33202, 33572, 33752, 34111, 34173, 34208, 34713, 35009, 35019, 35020, 35200, 35372, 35556, 35563, 35653, 35732, 36553, 37143, 37352, 37413, 37532

As for quintuplets, there are 451 of them in the range up to 40000. However, above 28000 there are only 16 and the initial or smallest members of each are:

30220, 30221, 30248, 30249, 30519, 31110, 31111, 31112, 32020, 32021, 32048, 32049, 32199, 32200, 32201, 35019

There are eight sextuplets: 30220, 30248, 31110, 31111, 32020, 32048, 32199, 32200.

There are two septuplets: 31110 and 32199 and no octuplets within the range.

Thursday, 28 May 2026

Full Report on Brun's Constants

 Here is Gemini's full report on Brun's Constants:

Comprehensive Analysis of Brun's Constants: Twin Primes (B2) and Prime Quadruplets (B4)

Introduction to Prime Constellations and Asymptotic Densities

Within the discipline of analytic number theory, the distribution of prime numbers across the integer continuum represents one of the most profound and heavily investigated landscapes for mathematical inquiry. While the Prime Number Theorem provides a robust asymptotic framework for the frequency of primes generally, dictating that the number of primes less than or equal to a given real number $x$ is approximately $x / \ln(x)$, the behavior of prime constellations remains an area of intense theoretical and computational research. Prime constellations are specific groupings of prime numbers separated by fixed, predetermined intervals. The simplest and most historically scrutinized of these constellations is the twin prime pair, consisting of two primes separated by a distance of two, taking the form $(p, p+2)$. Extending this logic to denser topologies yields higher-order constellations, such as prime quadruplets, which represent the closest permissible clustering of four distinct prime numbers.

Among the most significant mathematical discoveries regarding these constellations is Viggo Brun's 1919 theorem. Utilizing revolutionary combinatorial techniques that would later become known as Brun's sieve, he successfully established that the sum of the reciprocals of all twin primes converges to a distinct, finite limit. This limit is universally recognized today as Brun's Constant for twin primes, denoted as $B_2$. The convergence of this series fundamentally differentiated the set of twin primes from the set of all prime numbers. It is a foundational proof in mathematics, dating back to Leonhard Euler and later formalized by Mertens, that the sum of the reciprocals of all prime numbers diverges to infinity. By proving that the harmonic series of twin primes converges, Brun demonstrated that twin primes are exceptionally sparse compared to primes in general, laying the groundwork for modern sieve theory.

Beyond the twin prime pairs, the architecture of prime constellations extends to prime quadruplets. The sum of the reciprocals of these specific prime quadruplets similarly converges to a distinct finite value, identified as Brun's Constant for prime quadruplets, or $B_4$. Calculating the precise numerical values of these twin and quadruplet constants has historically functioned as a premier benchmark for computational mathematics. The extraction of $B_2$ and $B_4$ relies not merely on brute-force enumeration, which is mathematically inadequate due to the agonizingly slow convergence of the series, but on sophisticated asymptotic extrapolation models utilizing the Hardy-Littlewood conjectures, advanced prime sieving algorithms, and conditional bounds relying on the Generalized Riemann Hypothesis (GRH). This report provides an exhaustive, peer-level analysis of Brun's Constants, investigating the theoretical foundations of their convergence, the historical trajectory of their numerical estimation, modern algorithmic paradigms for tabulating prime patterns up to immense thresholds, and the rigorous unconditional and conditional upper bounds established by contemporary mathematical literature.

Theoretical Foundations of Viggo Brun's Theorem

The Density of Twin Primes and Sieve Theory

A twin prime is strictly defined as a pair of prime numbers $(p, p+2)$. To evaluate the distribution and overall density of these pairs, mathematicians utilize the twin prime counting function, denoted mathematically as $\pi_2(x)$, which quantifies the absolute number of primes $p \leq x$ for which $p+2$ is also a prime number. The convergence of the sum of the reciprocals of twin primes is a direct mathematical consequence of rigorous upper bounds established on the density of the twin prime sequence.

Brun's pioneering application of pure sieve methods allowed him to demonstrate a strict upper bound on this counting function. He proved that the number of twin primes less than $x$ obeys the following asymptotic limitation:

$$\pi_2(x) = O\left( \frac{x (\log \log x)^2}{(\log x)^2} \right)$$

This explicit bound is profoundly significant because it indicates that twin primes occur far less frequently than general primes, being separated by nearly an additional logarithmic factor. For general primes, the density is governed by $x / \log x$, whereas the twin prime density is suppressed by an additional divisor of $\log x$, alongside the highly dampening double-logarithmic numerator.

From this strict density bound, the mathematical intuition for convergence naturally emerges. By applying the techniques of partial summation to the density bound, the infinite sum of the reciprocals of the twin primes can be evaluated. The sum for Brun's Constant $B_2$ is defined as the addition of both elements of the twin prime pair:

$$B_2 = \left(\frac{1}{3} + \frac{1}{5}\right) + \left(\frac{1}{5} + \frac{1}{7}\right) + \left(\frac{1}{11} + \frac{1}{13}\right) + \left(\frac{1}{17} + \frac{1}{19}\right) + \dots$$

In explicit mathematical terms, this infinite series must either possess finitely many terms, or it must possess infinitely many terms that undergo strict and absolute convergence to a specific value. The determination of this value, $B_2$, defines the scope of twin prime research.

The Informational Paradox of Convergence

Brun's theorem holds immense historical weight within analytic number theory, yet it generates a profound informational paradox regarding the unresolved Twin Prime Conjecture. The Twin Prime Conjecture postulates that there are infinitely many twin primes spanning the integer continuum. If the sum of the reciprocals of twin primes diverged to infinity—exactly as it does for the set of all primes—that mathematical divergence would serve as undeniable, conclusive proof that there are infinitely many twin prime pairs.

Because the sum strictly converges to a finite value, the theorem remains entirely agnostic on the finiteness of the set itself. It is mathematically impossible to conclude from Brun's theorem alone whether the set of twin primes is finite or infinite; the convergence merely establishes that the twin primes form a relatively "small set" within the broader integer continuum. However, the arithmetic nature of Brun's Constant provides a conditional diagnostic tool that mathematicians continue to probe. If $B_2$ were ever formally proven to be an irrational number, it would definitively imply the existence of infinitely many twin primes. This is because any finite sum of rational numbers (which the reciprocals of primes are) must necessarily result in a rational number. Therefore, irrationality would guarantee an infinite series of terms. Conversely, if $B_2$ is ever proven to be a rational number, the Twin Prime Conjecture would remain an unsolved mystery, as infinite sums of rational numbers can readily converge to rational limits. Because the rationality of $B_2$ remains unknown, the evaluation of the constant relies heavily on expanding the numerical precision of its calculation.

The Hardy-Littlewood Conjecture and Asymptotic Extrapolation

The Computational Impossibility of Direct Summation

The summation of twin prime reciprocals poses an extreme computational hurdle for computer scientists and mathematicians: the series converges at an agonizingly slow and irregular pace. Directly summing the reciprocals of twin primes up to a specific prime threshold $p$, a value denoted as $B_2(p)$, fails to provide an accurate estimate of the true infinite sum $B_2$ due to massive truncation errors. Direct calculations reveal that $B_2(p)$ grows with high volatility in the lower integer registers and flattens out into imperceptible microscopic increments as $p$ scales.

To put the agonizing rate of this convergence into perspective, number theorists have calculated that if one were to rely strictly on direct, brute-force summation without predictive mathematical modeling, the physical value of the sum $B_2(p)$ would not even reach the integer threshold of 1.9 until $p$ approximated $10^{530}$. A computation of this colossal magnitude surpasses the theoretical limits of any physical computing architecture, demanding an alternative mathematical approach to circumvent the limitations of brute force.

Applying Conjecture B to Prime Pairs

To successfully bypass this computational ceiling, number theorists utilize asymptotic extrapolation derived directly from the Hardy-Littlewood Twin Prime Conjecture, widely referenced in mathematical literature as Conjecture B. Proposed in 1922, Conjecture B provides a highly accurate probabilistic approximation for the twin prime counting function $\pi_2(n)$ for substantially large values of $n$. The formulation relies on the logarithmic integral $Li_2(n)$ and is mathematically expressed as:

$$\pi_2(n) \sim 2C_2 Li_2(n) = 2C_2 \int_{2}^{n} \frac{dt}{\log^2(t)} \quad \text{or} \quad \pi_2(n) \sim 2C_2 \frac{n}{\log^2(n)}$$

In this formulation, $C_2$ represents the foundational twin prime constant. The necessity of $C_2$ arises from the fact that the probability of a number $n$ being prime is roughly $1/\ln(n)$, but the events of $n$ and $n+2$ being prime are not statistically independent due to shared divisibility traits (e.g., if $n$ is odd, $n+2$ is guaranteed to be odd). $C_2$ corrects for this arithmetic dependence and is defined as an infinite product spanning all primes $p \geq 3$:

$$C_2 = \prod_{p \geq 3} \left(1 - \frac{1}{(p-1)^2}\right) \approx 0.6601618158...$$

An elegant analytical consequence of this conjecture allows mathematicians to algebraically re-express the partial direct sums of Brun's constant, $B_2(p)$, incorporating an asymptotic error term. Using the Hardy-Littlewood framework, the relationship is strictly defined as:

$$B_2(p) = B_2 - \frac{4C_2}{\log(p)} + O\left(\frac{1}{\sqrt{p}\log(p)}\right)$$

The Extrapolated Sum Function $B^*_2(p)$

By isolating the true limit $B_2$ from the asymptotic expansion, mathematicians can define a newly extrapolated function, denoted as $B^*_2(p)$, which converges to the true limit of Brun's Constant at an exponentially faster rate than the raw direct sum. This extrapolated value is calculated dynamically as:

$$B^*_2(p) = B_2(p) + \frac{4C_2}{\log(p)}$$

Plotting the direct sum $B_2(p)$ as a function of the inverse logarithmic parameter $1/\log(p)$ generates a strictly linear relationship. The resulting line possesses a negative slope that mathematically approximates $-4C_2$, which evaluates numerically to -2.64064726. The theoretical point at which this extrapolated line intersects the vertical y-axis represents the infinite limit $p = \infty$, yielding the true theoretical value of Brun's Constant assuming the validity of the Hardy-Littlewood heuristics.

The drastic and immediate improvement provided by the Hardy-Littlewood extrapolation method is highly evident when comparing the direct summation against the extrapolated sums across ascending magnitudes of the prime threshold $p$. The data below illustrates this profound divergence in convergence efficiency:

Threshold $p$ Direct Sum $B_2(p)$ Extrapolated Sum $B^*_2(p)$
$10^2$ $1.330990365719...$ $1.904399633290...$
$10^4$ $1.616893557432...$ $1.903598191217...$
$10^6$ $1.710776930804...$ $1.901913353327...$
$10^8$ $1.758815621067...$ $1.902167937960...$
$10^{10}$ $1.787478502719...$ $1.902160356233...$
$10^{12}$ $1.806592419175...$ $1.902160630437...$
$10^{14}$ $1.820244968130...$ $1.902160577783...$
$10^{15}$ $1.825706013240...$ $1.902160582249...$
$10^{16}$ $1.830484424658...$ $1.902160583104...$

As demonstrated by the structured numerical data, at the extreme computational threshold of $p = 10^{16}$, the direct sum has merely reached 1.83048, representing an unacceptable relative truncation error. Conversely, the extrapolated sum has stabilized with extreme precision, providing the most robust modern estimates of the true value of $B_2$.

Chronology of Computational Estimation for $B_2$

The pursuit of an increasingly accurate numerical value for Brun's Constant has driven some of the most intensive computational mathematics efforts of the last century. Because estimating $B_2$ relies on summing billions of minuscule floating-point fractions, these efforts continuously operate at the absolute limits of contemporary microprocessor architecture.

Pre-Digital Enumerations to Early Supercomputing

The foundational efforts to estimate twin prime densities occurred entirely in the pre-computer era, relying on exhaustive manual arithmetic. In 1878, the mathematician J. W. L. Glaisher successfully enumerated $\pi_2(10^5)$ utilizing hand-calculated integer tables to study the localized distribution of prime pairs. Decades after Brun's 1919 proof of strict convergence, the advent of digital supercomputing allowed for massive expansions in algorithmic capability.

In 1974, Shanks and Wrench pushed the envelope by computing the twin primes up to 2 million, evaluating the constant's early trajectory. In 1976, Richard P. Brent utilized mainframe architecture to push this boundary to an unprecedented $1 \times 10^{11}$. His evaluation of irregularities in twin prime distributions produced a highly accurate heuristic estimate of $B_2 \approx 1.902160540$.

Thomas Nicely and the Pentium FDIV Bug

The most historically famous and consequential computation of Brun's Constant occurred in the mid-1990s through the independent work of Dr. Thomas R. Nicely. Attempting to generate a high-precision estimate, Nicely meticulously expanded the twin prime enumeration up to $10^{14}$. Because the computation of Brun's constant requires the consecutive addition of incredibly small fractional reciprocals floating at the extreme edge of machine precision, it acts as a severe mathematical stress-test for floating-point arithmetic hardware. Nicely noted that even after summing the first billion ($10^9$) terms, the relative error of the raw sum was still greater than 5%, necessitating absolute hardware reliability for the ensuing trillions of operations.

In 1994, during these exhausting calculations, Nicely noticed persistent inconsistencies in his extrapolated sums that defied mathematical logic. Subsequent rigorous debugging revealed that the discrepancy was not algorithmic, but rather physically embedded in the silicon: Nicely had discovered a critical flaw in the Floating-Point Unit (FPU) of the newly released Intel Pentium microprocessor. The hardware error, famously immortalized as the Pentium FDIV bug, caused the processor to return erroneous binary floating-point results when dividing certain numbers. Intel subsequently attributed the error to missing entries in the microcode lookup table utilized by the FPU for accelerated division algorithms. Specific hardware calculations, such as 0001 / 824633702441.0, failed silently, generating errors beyond the eighth significant digit which compounded disastrously in Nicely's massive summation loops.

Nicely's mathematical discovery forced a massive, multi-million-dollar hardware recall, costing Intel an estimated 475 million to 1 billion in write-offs, illustrating a unique historical intersection where pure analytic number theory served as an inadvertent diagnostic tool for industrial microprocessor architecture. Accounting for and correcting the hardware limitations, Nicely heuristically estimated Brun's constant at $B_2 \approx 1.902160578$ for the $10^{14}$ threshold.

The $10^{16}$ Threshold and Modern Refinements

The early 2000s marked the transition toward distributed, memory-optimized computations. In 2002, mathematicians Pascal Sebah and Patrick Demichel conducted an exhaustive evaluation of all twin primes up to $10^{16}$. Sebah verified Nicely's earlier results independently and expanded the raw sum of twin prime reciprocals strictly below $10^{16}$ to exactly $1.830484424658...$. Applying the Hardy-Littlewood extrapolation algorithm to this direct sum, Sebah and Demichel derived the current, globally accepted consensus estimate for Brun's Constant:

$$B_2 \approx 1.902160583104$$

Nicely himself continued to stretch these boundaries over the following decade, subsequently expanding his own prime pair computations to $1.6 \times 10^{15}$ by January 2010. These subsequent runs continually reinforced the mathematical stability of the 1.902160583 estimation, confirming that no anomalous density fluctuations existed in the higher prime registers.

The cultural footprint of this specific numerical constant even extended into corporate finance. When Google placed bids during the Nortel patent auction in 2011, they utilized famous mathematical constants to signal their strategic bidding architecture. One of their exact bids was precisely $1,902,160,540, mirroring the first ten digits of Brun's constant as derived by Richard Brent in 1976.

The Twin Prime Counting Function $\pi_2(n)$ at Extreme Scale

To achieve the precise evaluation of $B_2$, the absolute count of twin primes up to massive integers must be flawlessly tabulated. The behavior of the twin prime counting function $\pi_2(n)$ verifies the density limitations predicted by Hardy-Littlewood. Analytical tabulations show that as $n$ increases by orders of magnitude, the absolute count of twin primes grows, yet their relative density to the overall integer baseline continuously rarefies.

The absolute evaluation of twin primes up to $10^{18}$ showcases the computational magnitude required for these modern estimates:

Threshold $n$ Twin Prime Count $\pi_2(n)$
$10^{11}$ $224,376,048$
$10^{12}$ $1,870,585,220$
$10^{13}$ $15,834,664,872$
$10^{14}$ $135,780,321,665$
$10^{15}$ $1,177,209,242,304$
$10^{16}$ $10,304,195,697,298$
$10^{17}$ $90,948,839,353,159$
$10^{18}$ $808,675,888,577,436$

As the threshold escalates to $10^{18}$, observing over 808 trillion twin prime pairs validates the structural integrity of the $2C_2 n / (\ln \ln(n))^2$ predictive bounds, ensuring that no sudden divergences skew the calculation of the reciprocal sums.

Rigorous Analytical Bounds on Brun's Constant $B_2$

While the extrapolated heuristic value of 1.902160583104 is universally accepted as highly accurate by the computational mathematics community, proving rigorous unconditional bounds for the infinite sum remains an exceptionally complex analytical challenge. Direct enumeration only provides a floor for the sum; determining the strict mathematical ceiling requires bounding the error terms of infinite series. Significant advancements have been made in both unconditional mathematical frameworks and in bounds conditionally dependent on the Generalized Riemann Hypothesis (GRH).

Unconditional Upper Bounds

The first modern rigorous unconditional upper bound on Brun's Constant was established by Richard Crandall and Carl Pomerance. Relying strictly on proven density theorems and avoiding any unproven conjectures, Crandall and Pomerance definitively proved that $B_2 < 2.347$.

This bound remained the gold standard until a significant mathematical breakthrough was achieved in 2018. Mathematicians Dave Platt and Tim Trudgian published a comprehensive analysis that improved the unconditional bounds by approximately 13% over the prior published results. Utilizing Riesel and Vaughan's bounds for the counting function $\pi_2(x)$, Platt and Trudgian integrated improvements on older sieving inequalities originally developed by Montgomery and Vaughan. Furthermore, they utilized explicit analytical bounds on the sums of divisors to control the error variables at infinite scales.

Their integration techniques heavily utilized bounding equations of the form $\int t^{6/5} \log t$ and incorporated the Exponential Integral $Ei(x)$ to manage the convergence decay. Through this rigorous arithmetic interval analysis, Platt and Trudgian successfully established a tightened unconditional interval:

$$1.840503 < B_2 < 2.288513$$

(An intermediate optimized calculation within their framework also references a slightly tighter bound of $B_2 < 2.288490$). This tightened mathematical corridor limits the maximum theoretical ceiling of $B_2$ to 2.288513 without requiring the assumption of complex analytical conjectures, marking a triumph of unconditional sieve theory.

Bounds Conditional on the Generalized Riemann Hypothesis (GRH)

Considerably sharper bounds can be achieved by assuming the truth of the Generalized Riemann Hypothesis (GRH). GRH postulates that the non-trivial zeros of all Dirichlet L-functions lie precisely on the critical line where the real part equals 1/2. Because GRH allows for deeply restricted error terms regarding the distribution of primes in specific arithmetic progressions, it provides highly constrained, noise-free density bounds for twin primes.

In 2007, Dominic Klyve produced an unpublished doctoral thesis at Dartmouth College utilizing GRH to derive a substantially tighter upper bound. Klyve relied heavily on advanced numerical integration methods over constrained intervals to compute the subsequent bounds, ultimately showing conditionally that if GRH holds, $B_2 < 2.1754$.

The bounds were pushed further in 2025 by Lachlan Dunn, who published an analysis further constraining this conditional upper limit. Dunn achieved a rigorously proven upper bound of $B_2 < 2.1594$ under the explicit assumption of GRH. Dunn achieved this by developing a specialized sieve framework based on an intermediate sum architecture. Rather than attempting to bound the entire infinite sum directly as a monolithic entity, Dunn decomposed the mathematical evaluation into distinct, manageable regions.

These regions were represented as intervals $B(m_i, m_{i+1})$, where $m_1 = x_0$ up to an arbitrary boundary $k$. This intermediate sum approach provided critical analytical flexibility. Because different mathematical estimation methods yield tighter bounds over varying intervals of $x$, Dunn could apply highly specialized local estimations to each regional block. For instance, setting boundaries at $L_1 = 10^8$ and $L_2 = 10^{10}$, Dunn computed values exactly below $L_1$, utilized rounded checkpoints between $L_1$ and $L_2$, and applied a complex asymptotic approximation for values exceeding $L_2$, utilizing functions such as $D(L_2, z) = 12.6244 \sqrt{z} - 9 \sqrt{L_2}$. By combining these highly localized results and controlling the explicit error variables $E(x; [d_1, d_2])$, Dunn constructed a sharper, completely rigorous global bound under GRH, representing the definitive state-of-the-art constraint on $B_2$.

Advanced Sieving Algorithms and Computational Moduli

To truly appreciate the massive computational bounds reached for calculating $B_2$ at $10^{16}$, one must understand the underlying sieve optimizations utilized by researchers like Pascal Sebah to strip away computational redundancy and memory latency.

Direct software applications of the classical Sieve of Eratosthenes are highly inefficient at this scale because they force the processor to evaluate numbers irrespective of obvious composite traits. To exponentially accelerate the process of locating twin primes, modern sieve algorithms operate entirely within modular arithmetic frameworks utilizing a base $m$ (representing integers in the form $mk + r$, where $0 \leq r < m$). This mathematical representation drastically shrinks the physical subset of integers the CPU must actively load into memory to sieve.

Modulo Representations and the Primorial Function

If the base $m$ is chosen as the product of the first consecutive prime numbers—a value yielded by the primorial function $p\#$—algorithms can pre-eliminate vast swaths of composite numbers without executing a single division operation. The efficiency of this process is dictated by the primorial modulo function $\phi_2(m)$, which outputs the exact number of integer pairs $r$ and $r+2$ that remain relatively prime with $m$.

  • Modulo 6: Because all prime numbers greater than 3 must take the form $6k+1$ or $6k+5$, any search for twin primes can be strictly restricted. The computational sieve restricts itself purely to pairs of the form $(6k+5, 6k+7)$. This elementary optimization instantly drops the proportion of integer space required to process down to $\phi(m)/m = 2/6$, or exactly 33.3%.
  • Modulo 30: Scaling up the primorial base, primes greater than 5 exist solely in the modular forms $30k + r$ (where $r$ is restricted to $\{1, 7, 11, 13, 17, 19, 23, 29\}$). Restricting candidate couples specifically to $(30k+11, 30k+13)$, $(30k+17, 30k+19)$, and $(30k+29, 30k+31)$ drops the actively sieved proportion to $6/30$, or precisely 20%.

This optimization cascades dramatically as the primorial base expands, heavily reducing the strain on processor cache lines and memory bandwidth:

  • $m = 210$ ($2 \times 3 \times 5 \times 7$): The required sieve proportion drops to 14.3%.
  • $m = 2310$ ($210 \times 11$): The required sieve proportion drops to 11.7%.
  • $m = 30030$ ($2310 \times 13$): The required sieve proportion drops to 9.9%.
  • $m = 510510$ ($30030 \times 17$): The required sieve proportion drops to 8.7%.

In the landmark 2002 evaluation of Brun's Constant $B_2$ that successfully breached the $10^{16}$ integer threshold, Pascal Sebah structured his sieve algorithms to execute exactly at modulo 30030 and 510510. By mathematically forcing the algorithm to consider less than 10% of the integer continuum, the computation bypassed crippling floating-point bottlenecks, demonstrating how abstract algebraic structures directly catalyze hardware performance limits.

Prime Quadruplets and $B_4$: Structural and Theoretical Characteristics

Prime Constellations and Quadruplet Topology

While twin primes represent the simplest generalized prime constellation, number theorists dedicate equal scrutiny to denser, highly localized clusters. A prime quadruplet is formally defined as a sequence of four distinct prime numbers separated by the absolute minimum possible distances allowable by arithmetic.

Due to the rigid divisibility rules of integers modulo 3, the shortest possible distance separating four prime numbers cannot be a continuous span of 6 (such as the sequence $p, p+2, p+4, p+6$). In any such sequence, exactly one of the numbers is mathematically guaranteed to be divisible by 3, instantly rendering it composite. The only exception in all of mathematics to this rule is the singular cluster $(3, 5, 7)$, which forms a prime triplet but cannot extend to a quadruplet. Consequently, the absolute minimum distance capable of spanning four prime numbers is 8, forcing the constellation to adopt the strict structural form:

$$(p, p+2, p+6, p+8)$$

With the singular exception of the initial anomalous quadruplet $(5, 7, 11, 13)$, every prime quadruplet in existence must strictly follow the arithmetic progression form $\{30n + 11, 30n + 13, 30n + 17, 30n + 19\}$ for some integer $n$. This inflexible structural constraint guarantees that none of the four prime components are divisible by 2, 3, or 5. In standard base 10 representations, this arithmetic property means the first prime of any quadruplet always terminates in the digit 1, and the final prime of the quadruplet always terminates in the digit 9, a unique formation that is commonly referred to in number theory as a "prime decade". Intriguingly, the sequence of prime quadruplets $\{11, 13, 17, 19\}$ is alleged by some paleoanthropologists to appear carved into the ancient Ishango bone, marking a deep historical fascination with these specific numerical clusters, though this interpretation remains academically disputed.

Distinction from Cousin Primes and Fractal Topologies

It is critical in mathematical literature to strictly disambiguate Brun's Constant for prime quadruplets ($B_4$) from "Brun's Constant for cousin primes." Cousin primes are simply pairs of prime numbers separated by a gap of four, taking the form $(p, p+4)$. While the sum of the reciprocals of cousin primes is also convergant and occasionally designated ambiguously as $B_4$ in overlapping literature, it evaluates entirely differently from the quadruplet sum and represents a distinctly separate topological subset of prime pairs.

The behavior of cousin primes was extensively analyzed by mathematician Marek Wolf, who heuristically estimated the cousin prime constant at roughly 1.19704 utilizing primes up to $2^{42}$. Wolf's analysis revealed extraordinary structural properties when comparing the distribution of cousin primes against twin primes. By plotting the function $W(x)$, which represents the absolute numerical difference between the total count of twin primes and cousin primes up to $x$, Wolf demonstrated that the distribution difference possesses intense fractal properties.

The fractal dimension of the $W(x)$ plot is approximately 1.48. This value is mathematically significant because it is remarkably close to the fractal dimension of a standard Brownian motion path (random walk), suggesting that the localized dominance of twin primes over cousin primes—or vice versa—behaves as a stochastic, random process. Furthermore, Wolf utilized box-counting methods to show that the exact threshold points where the counts of twin primes and cousin primes are perfectly identical also form a fractal set with a dimension of roughly 0.51. These fractal dynamics underscore the profound geometrical complexity hidden within prime gaps, differentiating the analysis of cousin primes entirely from the rigid structure of prime quadruplets.

The Calculation and Density of $B_4$

Evaluating the Reciprocal Sum

Just as Viggo Brun utilized pure sieving techniques to prove the convergence of twin prime reciprocals in 1919, he simultaneously proved that the sum of the reciprocals of prime quadruplets strictly converges to a finite value. This limit defines Brun's Constant for prime quadruplets ($B_4$).

The value $B_4$ is defined mathematically as the infinite sum over all valid prime quadruplets:

$$B_4 = \sum \left(\frac{1}{p} + \frac{1}{p+2} + \frac{1}{p+6} + \frac{1}{p+8}\right)$$

Through massive computational effort mirroring his work on $B_2$, Thomas Nicely evaluated the sum of reciprocals for all prime quadruplets up to extreme hardware thresholds. By carefully managing the floating-point arithmetic to prevent truncation bleed, Nicely determined the constant with an exceptionally tight 99% confidence interval. The value is universally accepted as:

$$B_4 \approx 0.8705883800 \pm 0.0000000005$$

This figure establishes that the total density and inverse sum of prime quadruplets is substantially smaller than that of twin primes (1.902), an expected outcome given the extreme combinatorial rarity required for four primes to cluster sequentially within an integer span of eight.

Hardy-Littlewood Density for Quadruplets

Similar to the modeling of twin primes, the asymptotic density and absolute frequency of prime quadruplets can be accurately predicted using the generalized first Hardy-Littlewood conjecture. The frequency formula for a prime quadruple constellation $P_x(p, p+2, p+6, p+8)$ involves a highly complex multiplicative constant designed to correct for the probabilistic dependence of four localized prime events.

The Hardy-Littlewood constant tailored specifically for prime quadruplets is denoted as $c$. Unlike $C_2$, the constant $c$ is derived from a much more complex infinite product over all primes $p \geq 5$:

$$c = \frac{27}{2} \prod_{p \geq 5} \frac{p^3(p-4)}{(p-1)^4} \approx 4.151180864...$$

Using this exact corrective constant, the asymptotic frequency of prime quadruplets up to a boundary $x$ behaves proportionally to the logarithmic integral of the fourth degree:

$$P_x \sim c \int_{2}^{x} \frac{dt}{(\ln t)^4}$$

This mathematical model accurately mirrors the empirical sparsity of quadruplets as they trend toward infinity, providing the framework needed to extrapolate the trailing tail of the $B_4$ summation far beyond what computers can manually sieve.

Modern Algorithmic Paradigms for Prime Patterns

While Thomas Nicely originally drove enumeration algorithms up to $2 \cdot 10^{16}$ to ascertain the accepted value of $B_4$, computational demands inherently required severe algorithmic breakthroughs to push prime quadruplet tabulation beyond that physical memory threshold. In 2019 and 2020, researchers Jonathan P. Sorenson and Jonathan Webster published highly optimized algorithms designed explicitly for finding primes in generalized linear patterns.

Sorenson and Webster mathematically modeled the search for an admissible linear pattern $P = (f_1(x), \dots, f_k(x))$ of length $k$. By abstracting the sieve to a generalized polynomial format, they could dynamically detect generalized prime sequences—including twin primes where $k=2$, and prime quadruplets where $k=4$. The researchers introduced two primary algorithmic strategies that achieved unprecedented computational complexity limits, bypassing the traditional limitations of raw prime sieves.

  • Algorithm 1 (Time-Optimized): This approach requires $O_P(n / (\log \log n)^k)$ arithmetic operations while utilizing $O(k\sqrt{n})$ space. It achieves this highly accelerated state by extending the Atkin-Bernstein prime sieve and integrating it seamlessly with a space-saving wheel sieve framework, heavily minimizing unnecessary modulus checks.
  • Algorithm 2 (Space-Optimized): Recognizing that physical Random Access Memory (RAM) often throttles prime enumeration long before processor speed does, their second algorithm utilizes slightly more clock time—$O_P(n k / (\log \log n)^{k-1})$ arithmetic operations—but drastically reduces the memory requirements. It operates utilizing only $O(n^{1/c})$ space, where $c > 2$ is a fixed constant.

Deploying parallel implementations of the space-optimized Algorithm 2 across highly distributed computing hardware, Sorenson and Webster successfully found and tabulated every single prime quadruplet up to the massive threshold of $10^{17}$. In doing so, they successfully extended Nicely's original reciprocal sum data for $B_4$, evaluating the partial sums $S_4(X)$ across far higher intervals to verify the stability of the constant.

The results of their tabulation showcase the extreme precision of the $B_4$ convergence as it approaches the $10^{17}$ limit:

Threshold $X$ Quadruplet Count $\pi_4(X)$ Sum of Reciprocals $S_4(X)$
$1 \cdot 10^{16}$ $25,379,433,651$ $0.870477691234...$
$2 \cdot 10^{16}$ $46,998,268,431$ $0.870483710948...$
$3 \cdot 10^{16}$ $67,439,513,530$ $0.870487031043...$
$4 \cdot 10^{16}$ $87,160,212,807$ $0.870489302002...$

These algorithmic advancements establish 0.870588 as a mathematically rigid asymptote, empirically verifying that as the boundary reaches $10^{17}$, the reciprocal sum remains exceptionally tight and predictable, confirming the theoretical dampening modeled by the Hardy-Littlewood integral.

Analytical Implications and Future Trajectories

The ongoing, multi-generational research surrounding the precise calculation of $B_2$ and $B_4$ yields profound secondary insights into the intertwined disciplines of analytic number theory and computer science.

First, the historical interplay between prime number extrapolations and hardware capabilities highlights pure mathematics as an ultimate, unyielding stress-test for micro-architecture. The discovery of the Pentium FDIV bug by Thomas Nicely during his reciprocal sum tabulations serves as a vital historical benchmark. It confirmed that calculating reciprocal aggregates over highly sparse datasets exposes microscopic precision faults within arithmetic logic units that typical software validations and floating-point benchmarks fail to detect. The reciprocal sums of prime constellations will continue to serve as boundary-condition diagnostics for next-generation quantum hardware and highly parallelized computational processors.

Second, the structural reliance on the Generalized Riemann Hypothesis to formulate tighter bounds—such as Lachlan Dunn's 2025 refinement proving $B_2 < 2.1594$—reveals an explicit analytical bridge between the zero-distribution of the Riemann zeta function and the topological density of prime groupings. The fact that the most optimized unconditional upper bound (2.288513) established by Platt and Trudgian remains markedly looser than the GRH-conditional bound demonstrates the specific, quantifiable "shadow" that the unproven Riemann Hypothesis casts over prime distribution geometry. The numerical delta between these two values physically maps the exact degree of statistical noise that proving GRH would permanently eliminate from prime counting functions.

Finally, the shift toward algorithmically generalizing prime detection, as demonstrated by Sorenson and Webster's pattern sieve generating the $B_4$ quadruplet data up to $10^{17}$, signals a departure from single-constellation targeting. As modern space-optimized $O(n^{1/c})$ algorithms become universally adopted, the computational bottleneck for evaluating mathematical constants shifts away from physical memory limitations and strict computational overhead, moving toward fundamental integer factorization boundaries and combinatorial logic limits.

Conclusion

Brun's Constants occupy a uniquely critical junction in modern mathematics, acting simultaneously as a definitive analytical solution and an enduring informational enigma. Viggo Brun's 1919 proof that the reciprocals of twin primes and prime quadruplets strictly converge was instrumental in the maturation of combinatorial sieve theory, firmly establishing that localized prime groupings exist with vastly lower relative densities than the general prime sequence.

However, this strict mathematical convergence effectively blinds mathematicians from deducing the infinitude of these constellations. To extract their true numerical values, researchers cannot rely on brute computational force, as direct sum evaluations for $B_2 \approx 1.902160583$ would theoretically require prime enumerations approaching $10^{530}$ to achieve sufficient precision. Instead, analytic extrapolation through the sophisticated Hardy-Littlewood hypotheses acts as an obligatory mathematical bridge over the chasm of physical impossibility, successfully yielding the modern asymptotic constants $B_2 \approx 1.902160583104$ and $B_4 \approx 0.8705883800$.

The evolution of estimating these constants maps the parallel evolution of computational power. From Glaisher's rudimentary hand calculations in the 19th century, to Nicely's inadvertent auditing of microprocessor logic arrays, to Sorenson and Webster's highly parallel $10^{17}$ space-optimized tabulations, computational rigor has continually scaled. Simultaneously, theoretical constraints have tightened, reaching rigorous unconditional bounds set by Platt and Trudgian and highly optimized GRH-conditional limits derived by Dunn. The sustained pursuit of Brun's Constants continues to define the absolute frontiers of computational endurance, ensuring that prime constellations remain a central pillar of analytic number theory.

Wednesday, 27 May 2026

Brun's Constants

I came across this YouTube video on Brun's Constants that I found highly interesting. 


I asked Gemini to prepare a report on these constants. Here is a summary of what it came up  with:

A Brief Overview of Brun's Constants

In analytic number theory, Brun's theorem establishes a profound result regarding the distribution and density of twin primes. Formulated by the Norwegian mathematician Viggo Brun in 1919, the theorem proves that the sum of the reciprocals of all twin primes converges to a finite mathematical constant. This definitive sum is known as Brun's constant for twin primes, commonly denoted by \( B_2 \).

1. The Convergence of Twin Primes

To understand the significance of Brun's constant, it is necessary to contrast it with the behavior of regular prime numbers. It is a well-established fact, originally proven by Leonhard Euler, that the sum of the reciprocals of all prime numbers diverges to infinity:

\[ \sum_{p \text{ is prime}} \frac{1}{p} = \frac{1}{2} + \frac{1}{3} + \frac{1}{5} + \frac{1}{7} + \frac{1}{11} + \dots = \infty \]

However, Viggo Brun demonstrated through the use of combinatorial sieve methods (now known as Brun's sieve) that twin primes are vastly less frequent than primes in general. Even if there are infinitely many twin primes—as proposed by the unproven Twin Prime Conjecture—they are distributed sparsely enough that their reciprocal sum converges to a finite limit. If the sum had diverged, it would have served as a rigorous proof of the Twin Prime Conjecture. Because it converges, the conjecture remains one of the most famous unsolved problems in mathematics.

2. Mathematical Definition of \( B_2 \)

Brun's constant \( B_2 \) is explicitly defined as the sum of the reciprocals of the twin prime pairs \( (p, p+2) \):

\[ B_2 = \left(\frac{1}{3} + \frac{1}{5}\right) + \left(\frac{1}{5} + \frac{1}{7}\right) + \left(\frac{1}{11} + \frac{1}{13}\right) + \left(\frac{1}{17} + \frac{1}{19}\right) + \dots \]

More formally, it can be expressed as:

\[ B_2 = \sum_{p,\, p+2 \text{ are prime}} \left( \frac{1}{p} + \frac{1}{p+2} \right) \]

Due to the extremely slow convergence of this series, calculating the exact value of \( B_2 \) is computationally demanding. The most accurate heuristic estimates currently place the value of Brun's constant at approximately:

\[ B_2 \approx 1.902160583104 \]

3. The Pentium FDIV Bug Discovery

Brun's constant holds a unique place in the history of computer science. In 1994, Dr. Thomas R. Nicely, a mathematician at Lynchburg College, was utilizing an array of computers to calculate the sum of the reciprocals of twin primes to high precision. He noticed inconsistencies in his calculations when running his algorithms on machines equipped with the new Intel Pentium microprocessor.

Nicely traced these discrepancies to a flaw in the floating-point unit of the Pentium chip, specifically within its division algorithm. This hardware flaw, which became known as the Pentium FDIV bug, caused the processor to return inaccurate decimal results for certain floating-point division operations. Nicely's meticulous computational number theory research effectively exposed a massive hardware defect, leading to a recall by Intel that cost the company nearly half a billion dollars.

4. Brun's Constant for Prime Quadruplets (\( B_4 \))

The concept of Brun's constant extends beyond twin primes to other prime constellations. A prime quadruplet is a set of four primes of the form \( \{p, p+2, p+6, p+8\} \). Just as with twin primes, the sum of the reciprocals of prime quadruplets converges.

The sum is denoted as \( B_4 \) and is defined as:

\[ B_4 = \sum_{p,\, p+2,\, p+6,\, p+8 \text{ are prime}} \left( \frac{1}{p} + \frac{1}{p+2} + \frac{1}{p+6} + \frac{1}{p+8} \right) \]

The first few quadruplets in this series are \( \{5, 7, 11, 13\} \), \( \{11, 13, 17, 19\} \), and \( \{101, 103, 107, 109\} \). The approximate numerical value for \( B_4 \) is:

\[ B_4 \approx 0.8705883800 \]

Similar convergent constants exist for cousin primes (primes differing by 4) and sexy primes (primes differing by 6), further illustrating the application of Brun's sieve to integer sequences and prime constellations.

Sources & References

  • Brun, V. (1919). "La série \( 1/5 + 1/7 + 1/11 + 1/13 + 1/17 + 1/19 + 1/29 + 1/31 + \dots \) est convergente ou finie". Bulletin des Sciences Mathématiques.
  • Nicely, T. R. (1995). "Enumeration to \( 10^{14} \) of the twin primes and Brun's constant". Virginia Journal of Science.
  • Crandall, R., & Pomerance, C. (2005). Prime Numbers: A Computational Perspective. Springer-Verlag.
  • The On-Line Encyclopedia of Integer Sequences (OEIS): Sequence A065421 (Decimal expansion of Brun's constant).

Tuesday, 24 March 2026

Digit Manipulation


Video created by NotebookLM based on blog content

DIGITS TO SQUARES

Yesterday I turned 28113 days old and this number is a member of OEIS A048383: numbers \(k\) such that replacing each nonzero digit \(d\) with the \(d\)-th prime (replacing each 0 digit with a 1) yields a square. So this means that:$$28113 \rightarrow 319225 = 5^2 \times 113^2$$The members of this sequence are few and far between and in the range up to 40000 only the following numbers satisfy (permalink):$$ \begin{align} 0 &\rightarrow 1 = 1\\13 &\rightarrow 25 = 5^2\\113 &\rightarrow 225 = 3^2 \times 5^2\\2410 &\rightarrow 3721 = 61^2\\4113 &\rightarrow 7225 = 5^2 \times 17^2\\6113 &\rightarrow 13225 = 5^2 \times 23^2\\8210 &\rightarrow 19321 = 139^2\\14113 &\rightarrow 27225 = 3^2 \times 5^2 \times 11^2\\23410 &\rightarrow 35721 = 3^6 \times 7^2\\28113 &\rightarrow 319225 = 5^2 \times 113^2\\33113 &\rightarrow 55225 = 5^2 \times 47^2\\34010 &\rightarrow 57121 = 239^2\\35113 &\rightarrow 511225 = 5^2 \times 11^2 \times 13^2\\\end{align}$$DIGITS TO PRIMES

A variation on this theme is OEIS A048381:


A048381: numbers \(k\) such that replacing each nonzero digit \(d\) with the \(d\)-th prime (replacing each 0 digit with a 1) yields a prime.

Members of this sequence are far more numerous with 5629 in the range up to 40000. An example is 28112 since:$$28112 \rightarrow 319223 \text{ which is prime} $$Some upcoming members are:

28124, 28146, 28152, 28155, 28202, 28210, 28214, 28216, 28226, 28228, 28230, 28234, 28235, 28236, 28247, 28265, 28270, 28277, 28289, 28294, 28295, 28298, 28300, 28317, 28319, 28328, 28329, 28344, 28359, 28360, 28368, 28388, 28392, 28397, 28414, 28418, 28422, 28429, 28434, 28449, 28458, 28464, 28470, 28474, 28485, 28490, 28498, 28502, 28504, 28515, 28524, 28525, 28529, 28546, 28562, 28575, 28592, 28599, 28606, 28612, 28614, 28622, 28630, 28652, 28658, 28665, 28667, 28674, 28684, 28686, 28706, 28717, 28724, 28744, 28752, 28772, 28786, 28807, 28810, 28814, 28825, 28827, 28838, 28854, 28868, 28870, 28876, 28886, 28888, 28890, 28928, 28929, 28932, 28948, 28955, 28960, 28966, 28979, 28984, 28988, 28995, 28997

One way to thin the numbers when there are so many in a given range is to require that the numbers come in pairs that are consecutive integers. If this requirement is imposed then the 5629 reduces to 580. Imposing the restriction that the numbers are triplets that are consecutive integers reduces the 580 further to a manageable 103:

1, 2, 3, 4, 5, 6, 7, 24, 25, 144, 166, 167, 414, 474, 506, 674, 897, 898, 1026, 1027, 1176, 1177, 1398, 1516, 1824, 2035, 2074, 2094, 2146, 2544, 3316, 4044, 5247, 5248, 5286, 5514, 6044, 6484, 7116, 7117, 7118, 7264, 7918, 8008, 8127, 8444, 8665, 10016, 11046, 11047, 11404, 13068, 13445, 14224, 14584, 15886, 16055, 16346, 16347, 16505, 16945, 18306, 18497, 19276, 19465, 20044, 20124, 21797, 21798, 22167, 22416, 22417, 22586, 22694, 22767, 23336, 23774, 24726, 24727, 24845, 25934, 26608, 26844, 26885, 28234, 29376, 29377, 29714, 29715, 29917, 30145, 30705, 32244, 32248, 33807, 35405, 35647, 36018, 36635, 37888, 38097, 39067, 39527

Let's take 28234 as an example where:$$ \begin{align} 28234 &\rightarrow 319357\\28235 &\rightarrow 3193511\\28236 &\rightarrow 3193513 \end{align}$$There is of course an initial run of seven numbers (1 to 7) and after that there are runs of four numbers beginning with:

24, 166, 897, 1026, 1176, 5247, 7116, 7117, 11046, 16346, 21797, 22416, 24726, 29376, 29714

Finally there is only one run of five numbers and it starts with 7116.

DIGITS TO PALINDROMES

Another variation, using this same method of digit manipulation, is to ask what non-palindromic number become palindromes. Well, in the range up to 40000, it turns out that 333 numbers satisfy this condition (permalink). The numbers from 28113 onwards are:

28086, 28586, 28686, 28786, 28802, 28886, 29029, 29069, 29129, 29199, 29212, 29229, 29329, 29429, 29529, 29569, 29612, 29669, 29769, 29869, 29912, 29999, 30053, 30553, 30653, 30753, 30853, 32063, 32193, 32563, 32663, 32763, 32863, 32993, 34073, 34573, 34673, 34773, 34873, 35003, 35503, 36203, 36603, 36903, 37403, 37703, 38803, 39213, 39613, 39913

Let's use 28086 as an example:$$28086 \rightarrow 31911913$$Clearly there are many possible variations using just this particular type of digit manipulation and in this post I've shown examples of three of them where the digits \(d\) are manipulated as follows:$$ \begin{align} d &\rightarrow \text{ prime}(d) \text{ if } d \neq 0 \\0 &\rightarrow 1 \end{align} $$However, other manipulations are limited only by your imagination. An example of different type of manipulation would be:$$ d \rightarrow d^{ \, \small{2}}$$We can ask how many non-palindromic numbers become palindromes when their digits are manipulated in this manner (squared). In the range up to 40000, the answer is that there are 96 suitable numbers and they are (permalink):

19, 28, 37, 41, 72, 199, 288, 327, 377, 441, 461, 732, 772, 1191, 1281, 1371, 1411, 1721, 1919, 1999, 2192, 2282, 2372, 2412, 2722, 2828, 2888, 3193, 3207, 3217, 3227, 3237, 3283, 3373, 3413, 3723, 3737, 3777, 4141, 4441, 4661, 7032, 7132, 7232, 7272, 7332, 7772, 11991, 12881, 13271, 13771, 14411, 14611, 17321, 17721, 19019, 19119, 19219, 19319, 19999, 21992, 22882, 23272, 23772, 24412, 24612, 27322, 27722, 28028, 28128, 28228, 28328, 28888, 31993, 32007, 32117, 32197, 32227, 32287, 32337, 32377, 32417, 32727, 32883, 33273, 33773, 34413, 34613, 37037, 37137, 37237, 37277, 37323, 37337, 37723, 37777

An example is 28028 where$$28028 \rightarrow 4640464$$

Sunday, 25 May 2025

More on A + B + C = D and A + B = C

In my previous post titled A + B + C = D, I generated a list of 44 "d" numbers with the property that:$$a+b+c=d$$where \(a\), \(b\), \(c\) and \(d\) share the same digits and \(a<b<c\). The list of such numbers, up to 40000, is:

4617, 4851, 5103, 5184, 5913, 6021, 6129, 6192, 6219, 6291, 6921, 7182, 7281, 7416, 7614, 8145, 8154, 8253, 8325, 8451, 8514, 8523, 8541, 9135, 9216, 9234, 9324, 9612, 9621, 31860, 31905, 36171, 36711, 37116, 37161, 38061, 38106, 38151, 38214, 38511, 39051, 39105, 39411, 39501

In my post I noted the significant gap between sequence member 9621 and sequence member 31860. This was unfortunate as I'm currently 27811 days old and so all the numbers associated with my diurnal age, now and for some considerable time into the future, fall into this gap. The problem arises because I'm only displaying the sums, \(d\), resulting from the addition of the three smaller numbers \(a\), \(b\) and \(c\). I've gone back and rectified this.

What I needed to do was to extend the range of \(d\) numbers to 100,000 and then include all \(a\), \(b\), \(c\) and \(d\) numbers in a range let's say from 27810 to 40000. Doing this I get a far more useful list of numbers. Here is the expanded list (Google Doc link):

27810, 27864, 27891, 27936, 27954, 27963, 28017, 28026, 28035, 28062, 28071, 28116, 28125, 28161, 28170, 28179, 28197, 28206, 28215, 28260, 28269, 28359, 28413, 28458, 28467, 28476, 28512, 28521, 28539, 28548, 28593, 28611, 28647, 28674, 28692, 28701, 28710, 28719, 28746, 28764, 28791, 28845, 28854, 28863, 28917, 28935, 28953, 28962, 28971, 29016, 29034, 29043, 29061, 29106, 29160, 29178, 29187, 29268, 29304, 29340, 29358, 29367, 29385, 29394, 29439, 29448, 29475, 29493, 29538, 29583, 29601, 29610, 29628, 29637, 29673, 29682, 29718, 29754, 29763, 29781, 29817, 29835, 29853, 29871, 29961, 30015, 30150, 30159, 30168, 30195, 30285, 30294, 30429, 30492, 30519, 30582, 30591, 30627, 30681, 30726, 30825, 30852, 30924, 30942, 30951, 31059, 31068, 31149, 31158, 31176, 31185, 31464, 31491, 31509, 31590, 31599, 31608, 31635, 31644, 31653, 31680, 31689, 31698, 31761, 31788, 31806, 31815, 31842, 31860, 31869, 31878, 31896, 31905, 31959, 31968, 31986, 31995, 32049, 32076, 32085, 32148, 32418, 32481, 32490, 32499, 32580, 32607, 32679, 32697, 32760, 32769, 32796, 32814, 32841, 32850, 32859, 32886, 32895, 32904, 32958, 32967, 32976, 32985, 32994, 34029, 34119, 34128, 34164, 34182, 34218, 34281, 34299, 34461, 34614, 34641, 34812, 34821, 34911, 34992, 35019, 35082, 35091, 35109, 35118, 35190, 35217, 35271, 35631, 35712, 35721, 35802, 35820, 35829, 35892, 35910, 35982, 35991, 36018, 36108, 36117, 36135, 36144, 36153, 36171, 36198, 36261, 36279, 36288, 36297, 36315, 36351, 36414, 36513, 36531, 36621, 36711, 36729, 36792, 36810, 36819, 36918, 36927, 36972, 36981, 37116, 37125, 37161, 37179, 37197, 37215, 37251, 37269, 37296, 37521, 37611, 37629, 37719, 37917, 37962, 38016, 38061, 38106, 38115, 38142, 38151, 38160, 38169, 38187, 38196, 38214, 38241, 38286, 38295, 38412, 38511, 38529, 38592, 38610, 38619, 38682, 38691, 38817, 38826, 38871, 38916, 38925, 38952, 38961, 39015, 39024, 39042, 39051, 39105, 39150, 39159, 39177, 39186, 39195, 39204, 39258, 39285, 39402, 39411, 39420, 39492, 39501, 39510, 39528, 39582, 39591, 39618, 39627, 39672, 39681, 39717, 39726, 39762, 39816, 39825, 39852, 39861, 39942, 39951

Once a number is identified (whether it be an \(a\), \(b\), \(c\) or \(d\) number), then the other three members of the quadruplet can be called up. For example, \(27864\) is the \(b\) with \(a=27648, c=28764\) and \(d = 84276\). such that:$$27648+27864+28764=84276$$For want of a better term we might call these sorts of numbers \(a,b,c,d\) numbers. I have the following entry for them in my Bespoken for Sequences document on Google Docs where code can be located as well by following this permalink but execution may time out in SageMathCell so Jupyter notebook may be required or any software capable of running Python code:

Bespoken for Sequences link

A similar thing can be done with A + B = C. Here is the list of numbers between 27809 and 40000 with the property described below in Bespoken for Sequences where code can be located as well as by following this permalink but execution may time out in SageMathCell and so Jupyter notebook may be required or any software capable of running Python code:

Bespoken for Sequences link

27846, 27936, 27945, 27954, 27963, 28035, 28503, 28530, 28539, 28746, 28935, 28953, 29016, 29106, 29160, 29286, 29367, 29376, 29385, 29457, 29502, 29574, 29601, 29637, 29664, 29691, 29736, 29754, 29763, 29853, 30267, 30276, 30285, 30465, 30627, 30654, 30762, 30825, 31698, 31905, 31950, 31968, 32697, 32706, 32760, 32769, 32796, 32850, 32895, 32967, 32976, 32985, 34128, 34182, 34218, 34281, 34497, 34569, 34578, 34587, 34659, 34749, 34758, 34785, 34812, 34821, 34857, 34875, 34947, 35082, 35289, 35703, 35730, 35784, 35874, 35901, 35910, 36198, 36297, 36918, 36972, 37296, 37449, 37503, 37584, 37854, 38124, 38142, 38214, 38241, 38412, 38421, 38529, 38574, 38754, 38925, 38952, 39105, 39150, 39285, 39852

For example, 27846 is a member of this sequence with \(a=27846, b=46782\) and \(c=74628\):$$27846 + 46782 = 74628$$The code and details of all such triplets can be found in the links provided.

Saturday, 15 March 2025

Gapful Numbers Revisited

It was only recently (18th December 2024) that I made a post titled Gapful Numbers but today requires a second post about them because of the number associated with my diurnal age: 27740. This number marks the beginning of a run of three consecutive numbers with the properties that:

  • the number is gapful, meaning that the number formed by concatenating the first and last digits of the number, divides the numbers
  • the sum of the digits (SOD) of the number is also equal to the number formed by concatenating the first and last digits of the number
Thus we have:
  • 27740 \( \rightarrow \) 20 which divides it evenly and is equal to its SOD
  • 27741 \( \rightarrow \) 21 which divides it evenly and is equal to its SOD
  • 27742 \( \rightarrow \) 22 which divides it evenly and is equal to its SOD
In the range up to 40000, there are five groups of such triplets and they are:

  • 10094,10095 and 10096
  • 12255, 12256 and 12257
  • 12256, 12257 and 12258
  • 15134, 15135 and 15136
  • 27740, 27741 and 27742
However, as can seen there is actually a run of four consecutive numbers in the above list, namely 12255, 12256, 12257 and 12258. While such runs of four are rare, they become more frequent if we only require the numbers to be gapful and not have the SODs equal to the concatenated first and last digits of the number. In the range up to 40000, the quadruplets are then (permalink):
  • 10932, 10933, 10934 and 10935
  • 11229, 11230, 11231 and 11232
  • 12255, 12256, 12257 and 12258
  • 15408, 15409, 15410 and 15411
  • 16392, 16393, 16394 and 16395
  • 17170, 17171, 17172 and 17173

Tuesday, 11 February 2025

Primorials and the Sigma Function

I noticed that the sum of divisors (64680) of the number (27708) that represents my diurnal age today has the following factorisation:$$64680 = 2^3 \times 3 \times 5 \times 7^2 \times 11$$These prime factors, ignoring multiplicity, represent the factorisation of a primorial, in this case the primorial 2310:$$2310 = 2 \times 3 \times 5 \times 7 \times 11$$This got me wondering what other numbers in the range up to 40000 have a sum of divisors whose prime factors, again without multiplicity, form the primorial 2310. It turns out that there are 267 such numbers. They are (permalink):

1538, 2180, 2309, 2456, 2636, 2834, 3488, 3688, 3845, 4469, 4472, 4614, 4618, 4796, 4988, 5276, 6152, 6158, 6540, 6927, 7085, 7368, 7412, 7690, 7908, 7916, 8424, 8459, 8502, 8567, 8759, 8780, 8903, 8938, 9047, 9236, 9239, 9396, 9848, 9956, 10028, 10148, 10464, 10766, 11064, 11336, 11414, 11535, 11545, 11549, 11666, 11876, 11954, 12280, 12447, 12644, 13073, 13180, 13196, 13369, 13407, 13416, 13544, 13624, 13854, 13859, 14048, 14104, 14148, 14170, 14388, 14776, 14964, 14972, 15196, 15260, 15308, 15380, 15395, 15398, 15587, 15828, 16163, 16211, 16340, 16578, 16918, 17134, 17147, 17192, 17440, 17518, 17687, 17806, 17876, 17999, 18017, 18094, 18113, 18203, 18209, 18440, 18452, 18456, 18472, 18474, 18478, 19116, 19316, 19838, 19988, 19994, 20488, 20492, 20789, 21088, 21116, 21146, 21242, 21255, 21276, 22236, 22301, 22345, 22360, 22518, 22852, 23070, 23090, 23098, 23099, 23108, 23220, 23748, 23756, 23980, 24089, 24416, 24608, 24632, 24894, 24940, 25064, 25377, 25399, 25409, 25628, 25701, 25724, 25727, 25816, 26144, 26146, 26277, 26340, 26380, 26396, 26568, 26709, 26738, 26814, 26915, 27016, 27019, 27141, 27199, 27323, 27352, 27359, 27383, 27708, 27717, 27718, 27956, 28340, 28404, 28535, 28552, 28836, 28996, 29165, 29222, 29544, 29852, 29868, 29885, 30014, 30017, 30084, 30186, 30302, 30444, 30508, 30537, 30760, 30780, 30788, 30790, 30916, 30956, 31174, 31283, 31304, 31529, 31676, 31928, 31937, 32298, 32326, 32357, 32422, 32591, 32981, 33256, 33368, 33497, 33572, 33836, 33869, 33939, 34008, 34242, 34268, 34294, 34635, 34647, 34649, 34916, 34998, 35036, 35093, 35180, 35374, 35612, 35628, 35699, 35752, 35862, 35948, 35998, 36034, 36077, 36143, 36188, 36226, 36406, 36418, 36419, 36437, 36557, 36840, 36932, 36956, 37060, 37152, 37932, 38368, 38495, 38498, 38597, 38804, 39219, 39253, 39540, 39580, 39588, 39904

What caught my attention in this sequence of numbers was a pair of numbers that will be coming up for me in a little over a week. The numbers are 27717 and 27718. This got me to wondering if there were other such number pairs in the range up to 40000 and it turns out that there are. The other two are (23098, 23099) and (36418, 36419). See Table 1 for the details. 


Table 1

27718 also has the interesting property that its cototient has the same prime factors as 2310 since the totient is 13858 and thus the cototient is$$27718 - 13858 = 13860 = 2^2 \times 3^2 \times 5 \times 7 \times 11$$In the range up to 40000, the only numbers with this property are 4618, 9236, 18472, 18478, 23098, 27718 and 36956 (permalink). 

Anyway getting back on track, these pairs got me thinking about runs of three consecutive numbers and perhaps higher runs. I extended the range up to one million and in that range there are seven triplets of numbers whose sum of divisors consists form the factors of the primorial 2310. See Table 2.


Table 2

Looking at Table 2 it can be seen that there are two groups of quadruplets. See Table 3.


Table 3

Let's just double check the last quadrupets 692994, 692995, 692996 and 692997. See Table 4.


Table 4

So in terms of my diurnal age what's of interest is that the number pair 27717 and 27718 is coming up in a little over a week and its members share the interesting property discussed in this post. Let's move on to the primorial 210 = 2 x 3 x 5 x 7. In the range up to 40000, there are 1945 numbers with sums of divisors with prime factors (considered without multiplicity) that multiply together to give the primorial 210. I won't list them all but here is a permalink.

Restricting ourselves to the range up to 40000, we do get two groups of quintuplets. They are 20154 to 20158 and 29395 to 29399. 

Quadruplets are more numerous of course and Table 5 shows these.


Table 5: permalink

Groups of triplets are shown in Table 6.


Table 6: permalink

The pairs are too numerous to list here but this is a permalink.