Showing posts with label pairs. Show all posts
Showing posts with label pairs. Show all posts

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$$

Monday, 25 August 2025

Primes from Primes

Following on from my previous post, let's consider primes such that, when we add their consecutive pairs of digits together and concatenate them, we end up with another prime. Let's consider an example. I recently turned \( \textbf{27901}\) days old. This number is prime and this is what happens when we apply these operations to the number:$$  \underbrace{2+7}_{ \Large 9} \quad \underbrace{7+9}_{\Large 16} \quad  \underbrace{9+0}_{ \Large 9} \quad \underbrace{0+1}_{ \Large 1} \rightarrow 91691 \text{ a prime number}  $$In the range up to 40000, there are 403 numbers that satisfy the criteria. I'll show the 101 numbers from 27901 to 40000 below (permalink):

27901, 28081, 28163, 28201, 28229, 28447, 28607, 28621, 28627, 28661, 28703, 28867, 28927, 28961, 29009, 29021, 29063, 29129, 29167, 29201, 29207, 29221, 29401, 29567, 29789, 29881, 29921, 30029, 30089, 30109, 30427, 30509, 30643, 30649, 30763, 30781, 30809, 30829, 30983, 31249, 31627, 31663, 31849, 31883, 32009, 32089, 32189, 32401, 32429, 32563, 32609, 32749, 32843, 32909, 33029, 33149, 33289, 33349, 33529, 33601, 33829, 33889, 34147, 34261, 34327, 34483, 34501, 34583, 34589, 34807, 34963, 35089, 35129, 35401, 35461, 35543, 35603, 36109, 36209, 36229, 36721, 36901, 37021, 37189, 37409, 37589, 37747, 37963, 38047, 38149, 38461, 38629, 38707, 38729, 39103, 39229, 39409, 39503, 39749, 39829, 39929

Let's take the last number, 39929, as a second example:$$  \underbrace{3+9}_{ \Large 12} \quad \underbrace{9+9}_{\Large 18} \quad  \underbrace{9+2}_{ \Large 11} \quad \underbrace{2+9}_{ \Large 11} \rightarrow 12181111 \text{ a prime number}  $$For completeness, here are primes that arise from the above primes:

27901 --> 91691
28081 --> 10889
28163 --> 10979
28201 --> 101021
28229 --> 1010411
28447 --> 1012811
28607 --> 101467
28621 --> 101483
28627 --> 101489
28661 --> 1014127
28703 --> 101573
28867 --> 10161413
28927 --> 1017119
28961 --> 1017157
29009 --> 11909
29021 --> 11923
29063 --> 11969
29129 --> 1110311
29167 --> 1110713
29201 --> 111121
29207 --> 111127
29221 --> 111143
29401 --> 111341
29567 --> 11141113
29789 --> 11161517
29881 --> 1117169
29921 --> 1118113
30029 --> 30211
30089 --> 30817
30109 --> 3119
30427 --> 3469
30509 --> 3559
30643 --> 36107
30649 --> 361013
30763 --> 37139
30781 --> 37159
30809 --> 3889
30829 --> 381011
30983 --> 391711
31249 --> 43613
31627 --> 4789
31663 --> 47129
31849 --> 491213
31883 --> 491611
32009 --> 5209
32089 --> 52817
32189 --> 53917
32401 --> 5641
32429 --> 56611
32563 --> 57119
32609 --> 5869
32749 --> 591113
32843 --> 510127
32909 --> 51199
33029 --> 63211
33149 --> 64513
33289 --> 651017
33349 --> 66713
33529 --> 68711
33601 --> 6961
33829 --> 6111011
33889 --> 6111617
34147 --> 75511
34261 --> 7687
34327 --> 7759
34483 --> 781211
34501 --> 7951
34583 --> 791311
34589 --> 791317
34807 --> 71287
34963 --> 713159
35089 --> 85817
35129 --> 86311
35401 --> 8941
35461 --> 89107
35543 --> 81097
35603 --> 81163
36109 --> 9719
36209 --> 9829
36229 --> 98411
36721 --> 91393
36901 --> 91591
37021 --> 10723
37189 --> 108917
37409 --> 101149
37589 --> 10121317
37747 --> 10141111
37963 --> 1016159
38047 --> 118411
38149 --> 119513
38461 --> 1112107
38629 --> 1114811
38707 --> 111577
38729 --> 1115911
39103 --> 121013
39229 --> 1211411
39409 --> 121349
39503 --> 121453
39749 --> 12161113
39829 --> 12171011
39929 --> 12181111

What if we convert the prime numbers in base 10 to numbers in other bases. These numbers will remain prime of course and then we apply the operations but in our chosen base. Let's work with base 9. In the range from 27901 up to 40000, 121 numbers satisfy (permalink):

28123, 28211, 28279, 28297, 28463, 28513, 28517, 28549, 28621, 28663, 28697, 28711, 28789, 28859, 28933, 29167, 29221, 29251, 29269, 29399, 29527, 29581, 29669, 29683, 29759, 29761, 29917, 29921, 30013, 30133, 30139, 30187, 30553, 30677, 30763, 30839, 30841, 30871, 30949, 31159, 31181, 31219, 31249, 31271, 31357, 31397, 31489, 31541, 32059, 32077, 32083, 32099, 32353, 32491, 32497, 32621, 32653, 32783, 32917, 32939, 32987, 33149, 33331, 33461, 33479, 33581, 33617, 33619, 33641, 33851, 34019, 34033, 34127, 34211, 34303, 34429, 34537, 34607, 34757, 34897, 34913, 34919, 35081, 35291, 35363, 35401, 35423, 35509, 35617, 35671, 35747, 35837, 35869, 35923, 35963, 35993, 36011, 36389, 36479, 36571, 36767, 36857, 36929, 37199, 37273, 37307, 37313, 37361, 37397, 37997, 38083, 38261, 38321, 38447, 38461, 38677, 38933, 39041, 39233, 39239, 39857

Let's look at 39239, the second last number in that list. It becomes 58738 in base 9.$$ \begin{align} 28219_{\, 10} = 58738_{ \, 9} &\rightarrow \underbrace{5+8}_{ \Large 14} \quad \underbrace{8+7}_{\Large 16} \quad \underbrace{7+3}_{ \Large 11} \quad \underbrace{3+8}_{ \Large 12}\\ \\ &\rightarrow 14161112_{\,9} \text{ a prime number} \\ \\ &= 7007969_{\,10} \text{ also prime} \end{align}$$The details are as follows (first column is base 10 prime, second column is prime in base 9, third prime is the prime resulting from the operations of addition and concatenation in base 9 and the fourth column is the prime converted to a prime in base 10.

28123 --> 42517 --> 6768 --> 5003
28211 --> 42625 --> 6887 --> 5101
28279 --> 42711 --> 61082 --> 40169
28297 --> 42731 --> 610114 --> 360949
28463 --> 43035 --> 7338 --> 5381
28513 --> 43101 --> 7411 --> 5437
28517 --> 43105 --> 7415 --> 5441
28549 --> 43141 --> 7455 --> 5477
28621 --> 43231 --> 7554 --> 5557
28663 --> 43277 --> 751015 --> 446891
28697 --> 43325 --> 7657 --> 5641
28711 --> 43341 --> 7675 --> 5657
28789 --> 43437 --> 77711 --> 51607
28859 --> 43525 --> 7877 --> 5821
28933 --> 43617 --> 71078 --> 46727
29167 --> 44007 --> 8407 --> 6163
29221 --> 44067 --> 84614 --> 55903
29251 --> 44111 --> 8522 --> 6257
29269 --> 44131 --> 8544 --> 6277
29399 --> 44285 --> 861114 --> 512581
29527 --> 44447 --> 88812 --> 58979
29581 --> 44517 --> 81068 --> 53279
29669 --> 44625 --> 81187 --> 53377
29683 --> 44641 --> 811115 --> 479777
29759 --> 44735 --> 812118 --> 480509
29761 --> 44737 --> 8121111 --> 4324519
29917 --> 45031 --> 10534 --> 6997
29921 --> 45035 --> 10538 --> 7001
30013 --> 45147 --> 106512 --> 63839
30133 --> 45301 --> 10831 --> 7237
30139 --> 45307 --> 10837 --> 7243
30187 --> 45361 --> 108107 --> 64969
30553 --> 45817 --> 1014108 --> 541007
30677 --> 46065 --> 116612 --> 70481
30763 --> 46171 --> 11788 --> 7937
30839 --> 46265 --> 118812 --> 72101
30841 --> 46267 --> 118814 --> 72103
30871 --> 46311 --> 111042 --> 66377
30949 --> 46407 --> 111147 --> 66463
31159 --> 46661 --> 1113137 --> 599353
31181 --> 46685 --> 11131514 --> 5394289
31219 --> 46737 --> 11141111 --> 5400523
31249 --> 46771 --> 1114158 --> 600101
31271 --> 46805 --> 111585 --> 66821
31357 --> 47011 --> 12712 --> 8597
31397 --> 47055 --> 127511 --> 77689
31489 --> 47167 --> 128714 --> 78583
31541 --> 47235 --> 121058 --> 72953
32059 --> 47871 --> 1216168 --> 660617
32077 --> 48001 --> 13801 --> 9397
32083 --> 48007 --> 13807 --> 9403
32099 --> 48025 --> 13827 --> 9421
32353 --> 48337 --> 1312611 --> 717103
32491 --> 48511 --> 131462 --> 79841
32497 --> 48517 --> 131468 --> 79847
32621 --> 48665 --> 13151312 --> 6470129
32653 --> 48711 --> 131682 --> 80021
32783 --> 48865 --> 13171512 --> 6483413
32917 --> 50134 --> 5147 --> 3769
32939 --> 50158 --> 51614 --> 34033
32987 --> 50222 --> 5244 --> 3847
33149 --> 50422 --> 5464 --> 4027
33331 --> 50644 --> 56118 --> 37277
33461 --> 50808 --> 5888 --> 4373
33479 --> 50828 --> 581111 --> 348553
33581 --> 51052 --> 6157 --> 4507
33617 --> 51102 --> 6212 --> 4547
33619 --> 51104 --> 6214 --> 4549
33641 --> 51128 --> 62311 --> 41077
33851 --> 51382 --> 641211 --> 381439
34019 --> 51588 --> 661417 --> 394729
34033 --> 51614 --> 6775 --> 5009
34127 --> 51728 --> 681011 --> 407521
34211 --> 51832 --> 610125 --> 360959
34303 --> 52044 --> 7248 --> 5309
34429 --> 52204 --> 7424 --> 5449
34537 --> 52334 --> 7567 --> 5569
34607 --> 52422 --> 7664 --> 5647
34757 --> 52608 --> 7868 --> 5813
34897 --> 52774 --> 7101512 --> 3780281
34913 --> 52802 --> 71182 --> 46811
34919 --> 52808 --> 71188 --> 46817
35081 --> 53108 --> 8418 --> 6173
35291 --> 53362 --> 86108 --> 56951
35363 --> 53452 --> 87107 --> 57679
35401 --> 53504 --> 8854 --> 6529
35423 --> 53528 --> 88711 --> 58897
35509 --> 53634 --> 810107 --> 479041
35617 --> 53764 --> 8111411 --> 4318201
35671 --> 53834 --> 812127 --> 480517
35747 --> 54028 --> 104211 --> 62137
35837 --> 54138 --> 105412 --> 63029
35869 --> 54174 --> 105812 --> 63353
35923 --> 54244 --> 10668 --> 7109
35963 --> 54288 --> 1061117 --> 571633
35993 --> 54332 --> 10765 --> 7187
36011 --> 54352 --> 10787 --> 7207
36389 --> 54822 --> 1013114 --> 540283
36479 --> 55032 --> 11535 --> 7727
36571 --> 55144 --> 11658 --> 7829
36767 --> 55382 --> 1181211 --> 643879
36857 --> 55502 --> 111152 --> 66467
36929 --> 55582 --> 11111411 --> 5381083
37199 --> 56022 --> 12624 --> 8527
37273 --> 56114 --> 12725 --> 8609
37307 --> 56152 --> 12767 --> 8647
37313 --> 56158 --> 127614 --> 77773
37361 --> 56222 --> 12844 --> 8707
37397 --> 56262 --> 12888 --> 8747
37997 --> 57108 --> 13818 --> 9413
38083 --> 57214 --> 131035 --> 79493
38261 --> 57432 --> 131275 --> 79691
38321 --> 57508 --> 131358 --> 79757
38447 --> 57658 --> 13141214 --> 6463489
38461 --> 57674 --> 13141412 --> 6463649
38677 --> 58044 --> 14848 --> 10169
38933 --> 58358 --> 1412814 --> 776317
39041 --> 58488 --> 14131317 --> 6988453
39233 --> 58732 --> 1416115 --> 778667
39239 --> 58738 --> 14161112 --> 7007969
39857 --> 60605 --> 6665 --> 4919

Saturday, 1 March 2025

Efficient Sorting Algorithm

 Here is a problem that I came across today. Here is the link.


Place each of the numbers from 1 to 15 into the spaces provided so that the sum of any two consecutive spaces is a square number. The following clue was provided: the number 8 must be placed on one end and the number 9 must be placed on the other end.

Without the clue, there are a staggering 1,307,674,368,000 possible permutations (that's over one trillion) but with the clue this reduces to 6,227,020,800 or a little over six billion. However, the clue is very helpful because we know that next to 8 we can only place a 1 and next to the 9 we can only place a 7. So we have:$$9, 7, x, x, x, x, x, x, x, x, x, x, x, 1, 8$$Now next to the 7 we can only place a 2 and next to the 1 we can only place a 15, so we now have:$$9, 7, 2, x, x, x, x, x, x, x, x, x, 15, 1, 8$$Next to the 2 we can only place 14 and next to the 15 we can only place a 10. This gives$$9, 7, 2, 14, x, x, x, x, x, x, x, 10, 15, 1, 8$$Continuing this process, we find 14 can only be paired with 11 and 10 with 6. We now have:$$9, 7, 2, 14, 11, x, x, x, x, x, 6, 10, 15, 1, 8$$We then quickly reach our solution:



The key to solving the problem is to begin and end the sequence of numbers with 8 and 9 or vice versa because these two initial choices determine all the remaining numbers. I asked Gemini to write a Python program to solve the problem but without giving it any clues. I also asked it to explain its thinking. Figure 1 is what it came up with, in about 67 lines of code.


Figure 1: Gemini Link

Here is how Gemini described its thinking:
\( \textbf{Reasoning and Strategies:}\)

is_square(n) \( \textbf{Function} \):
  • This function efficiently checks if a number is a perfect square. It calculates the integer square root and compares its square to the original number. 
find_next(current_sequence, remaining_numbers) \( \textbf{Function (Recursive Backtracking:)} \)
  • This function uses recursion to explore possible sequences.
  • It checks if the current sequence is complete (no remaining numbers).
  • For each remaining number, it checks if it forms a square sum with the last number in the current sequence.
  • If a square sum is found, it adds the number to the sequence and recursively calls itself with the updated sequence and remaining numbers.
  • If no valid next number is found, it backtracks. 
\( \textbf{Optimization} \) 
\( \textbf{Precompute Possible Pairs (Graph Representation): }  \)
  • Instead of repeatedly checking for square sums, we precompute all possible pairs of numbers that add to a square.
  • This is stored in the possible_pairs dictionary, which represents a graph where numbers are nodes, and edges exist between numbers that form a square sum.
  • This optimization significantly reduces the number of square sum calculations. 
\( \textbf{Optimization} \) 
\( \textbf{Start with Numbers with Fewer Possible Pairs:} \)
  • The sorted_numbers list is created by sorting the numbers based on the number of possible pairs they have.
  • Starting the search with numbers that have fewer possible pairs reduces the branching factor in the recursive search. This means the algorithm explores fewer potential paths, leading to faster results.
  • This is a heuristic that helps avoid exploring large portions of the search space that are unlikely to lead to a solution. 
\( \textbf{Backtracking Efficiency}: \)
  • The recursive backtracking algorithm is designed to efficiently explore the search space. When a dead end is encountered (no valid next number), the algorithm immediately backtracks to the previous decision point, avoiding unnecessary exploration of other paths.
  • By combining the precomputation of possible pairs and the heuristic of starting with numbers with fewer options, the backtracking algorithm becomes much more efficient than a naive brute-force approach.
The algorithm (permalink) is easily adapted for longer runs of numbers. For example, let's say we want to arrange the number from 1 to 35. Here is one configuration (generated almost instantly):

[18, 7, 2, 14, 11, 5, 31, 33, 3, 22, 27, 9, 16, 20, 29, 35, 1, 8, 28, 21, 4, 32, 17, 19, 6, 30, 34, 15, 10, 26, 23, 13, 12, 24, 25] ... permalink

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.

Thursday, 5 December 2024

Concatenated Triples Of Cubes and Doubles of Squares

The number associated with my diurnal age today, 27640, has the property that it is a sum of concatentated cubes:$$ \begin{align} 27640 &= 27 \, | \,64  \,|\, 0\\ &= 3^3  \,| \, 4^3 \, |\, 0^3 \end{align}$$I then sought to discover what other numbers in the range up to 40,000 have this property. It turns out that there are 78 such numbers and they are (permalink):

108, 180, 801, 810, 1027, 1064, 1270, 1278, 1640, 1648, 1827, 1864, 2701, 2708, 2710, 2718, 2780, 2781, 6401, 6408, 6410, 6418, 6480, 6481, 8027, 8064, 8127, 8164, 8270, 8271, 8640, 8641, 10125, 10216, 10343, 10512, 10729, 11250, 11258, 12160, 12168, 12501, 12508, 12510, 12518, 12580, 12581, 12764, 13430, 13438, 15120, 15128, 16427, 17290, 17298, 18125, 18216, 18343, 18512, 18729, 21601, 21608, 21610, 21618, 21680, 21681, 27064, 27164, 27640, 27641, 27648, 27864, 34301, 34308, 34310, 34318, 34380, 34381

Let's take the last member of the above set:$$ \begin{align} 34381 &= 343 \, | \, 8 \, | \, 1\\ & =7^3 \, | \, 2^3 \, | \, 1^3 \end{align} $$It can be noted that 27640 and 27641 form a pair of consecutive numbers sharing this same property. In the range up to 40,000 this pairing occurs as shown:

  • 2780 and 2781
  • 6480 and 6481
  • 8270 and 8271
  • 8640 and 8641
  • 12580 and 12581
  • 21680 and 21681
  • 27640 and 27641
  • 34380 and 34381
If instead of cubes, we consider squares and instead of triples we consider doubles then we have the following 557 numbers in the range up to 40,000 (permalink):

10, 14, 19, 40, 41, 49, 90, 91, 94, 116, 125, 136, 149, 160, 161, 164, 164, 169, 181, 250, 251, 254, 259, 360, 361, 364, 369, 416, 425, 436, 449, 464, 481, 490, 491, 494, 499, 640, 641, 644, 649, 810, 811, 814, 819, 916, 925, 936, 949, 964, 981, 1000, 1001, 1004, 1009, 1100, 1121, 1144, 1169, 1196, 1210, 1211, 1214, 1219, 1225, 1256, 1289, 1324, 1361, 1400, 1440, 1441, 1441, 1444, 1449, 1484, 1529, 1576, 1625, 1625, 1636, 1649, 1664, 1676, 1681, 1690, 1691, 1694, 1699, 1729, 1784, 1841, 1900, 1960, 1961, 1961, 1964, 1969, 2250, 2251, 2254, 2259, 2516, 2536, 2549, 2560, 2561, 2564, 2564, 2569, 2581, 2890, 2891, 2894, 2899, 3240, 3241, 3244, 3249, 3610, 3611, 3614, 3616, 3619, 3625, 3649, 3664, 3681, 4000, 4001, 4004, 4009, 4100, 4121, 4144, 4169, 4196, 4225, 4256, 4289, 4324, 4361, 4400, 4410, 4411, 4414, 4419, 4441, 4484, 4529, 4576, 4625, 4676, 4729, 4784, 4840, 4841, 4841, 4844, 4849, 4900, 4916, 4925, 4936, 4961, 4964, 4981, 5290, 5291, 5294, 5299, 5760, 5761, 5764, 5769, 6250, 6251, 6254, 6259, 6416, 6425, 6436, 6449, 6481, 6760, 6761, 6764, 6769, 7290, 7291, 7294, 7299, 7840, 7841, 7844, 7849, 8116, 8125, 8136, 8149, 8164, 8410, 8411, 8414, 8419, 9000, 9001, 9004, 9009, 9100, 9121, 9144, 9169, 9196, 9225, 9256, 9289, 9324, 9361, 9400, 9441, 9484, 9529, 9576, 9610, 9611, 9614, 9619, 9625, 9676, 9729, 9784, 9841, 9900, 9961, 10016, 10025, 10036, 10049, 10064, 10081, 10240, 10241, 10244, 10249, 10890, 10891, 10894, 10899, 11024, 11089, 11156, 11225, 11296, 11369, 11444, 11521, 11560, 11561, 11564, 11569, 11600, 11681, 11764, 11849, 11936, 12025, 12116, 12116, 12125, 12136, 12149, 12164, 12181, 12209, 12250, 12251, 12254, 12259, 12304, 12401, 12500, 12601, 12704, 12809, 12916, 12960, 12961, 12964, 12969, 13025, 13136, 13249, 13364, 13481, 13600, 13690, 13691, 13694, 13699, 13721, 13844, 13969, 14096, 14225, 14356, 14416, 14425, 14436, 14440, 14441, 14444, 14449, 14449, 14464, 14481, 14489, 14624, 14761, 14900, 15041, 15184, 15210, 15211, 15214, 15219, 15329, 15476, 15625, 15776, 15929, 16000, 16001, 16004, 16009, 16084, 16100, 16121, 16144, 16169, 16196, 16225, 16241, 16256, 16289, 16324, 16361, 16400, 16400, 16441, 16484, 16529, 16561, 16576, 16625, 16676, 16724, 16729, 16784, 16810, 16811, 16814, 16819, 16841, 16889, 16900, 16916, 16925, 16936, 16949, 16961, 16964, 16981, 17056, 17225, 17396, 17569, 17640, 17641, 17644, 17649, 17744, 17921, 18100, 18281, 18464, 18490, 18491, 18494, 18499, 18649, 18836, 19025, 19216, 19360, 19361, 19364, 19369, 19409, 19604, 19616, 19625, 19636, 19649, 19664, 19681, 19801, 20250, 20251, 20254, 20259, 21160, 21161, 21164, 21169, 22090, 22091, 22094, 22099, 22516, 22525, 22536, 22549, 22564, 22581, 23040, 23041, 23044, 23049, 24010, 24011, 24014, 24019, 25000, 25001, 25004, 25009, 25100, 25121, 25144, 25169, 25196, 25225, 25256, 25289, 25324, 25361, 25400, 25441, 25484, 25529, 25576, 25616, 25625, 25625, 25636, 25649, 25664, 25676, 25681, 25729, 25784, 25841, 25900, 25961, 26010, 26011, 26014, 26019, 27040, 27041, 27044, 27049, 28090, 28091, 28094, 28099, 28916, 28925, 28936, 28949, 28964, 28981, 29160, 29161, 29164, 29169, 30250, 30251, 30254, 30259, 31360, 31361, 31364, 31369, 32416, 32425, 32436, 32449, 32464, 32481, 32490, 32491, 32494, 32499, 33640, 33641, 33644, 33649, 34810, 34811, 34814, 34819, 36000, 36001, 36004, 36009, 36100, 36116, 36121, 36125, 36136, 36144, 36149, 36164, 36169, 36181, 36196, 36225, 36256, 36289, 36324, 36361, 36400, 36441, 36484, 36529, 36576, 36625, 36676, 36729, 36784, 36841, 36900, 36961, 37210, 37211, 37214, 37219, 38440, 38441, 38444, 38449, 39690, 39691, 39694, 39699

Let's take the last number in the above set of numbers:$$ \begin{align} 39699 &= 3969 \, | \, 9 \\ &= 63^2 \, | \, 3^2 \end{align}$$One more example is:$$ \begin{align} 36000 &= 3600 \, | \, 0 \\ &= 60^2 \, | \, 0^2 \end{align} $$There are obviously many other variation on these themes but that will suffice for now.

Sunday, 4 February 2024

Some Sequences Involving Prime Factors

One of the properties of the number associated with my diurnal age today, 27335, is that it's a member of OEIS A020700:


 A020700

Numbers \(k\) such that \(k\) + sum of its prime factors = (\(k\)+1) + sum of its prime factors.


Let's confirm that 27335 does indeed have this property:$$ \begin{align} 27335 &= 5 \times 7 \times 11 \times 71 \\5 + 7 + 11 + 71 &= 94\\27335+94 &=27429 \\27336 &= 2^3 \times 3 \times 17 \times 67\\ 2+2+2 + 3 + 17+ 67 &= 93\\ 27336+93 &= 27429 \end{align} $$The initial members of the sequence are (permalink):

7, 14, 63, 80, 224, 285, 351, 363, 475, 860, 902, 1088, 1479, 2013, 2023, 3478, 3689, 3925, 5984, 6715, 8493, 9456, 13224, 15520, 17227, 18569, 19502, 20490, 21804, 24435, 24476, 27335, 31899, 32390, 35815, 37406, 37582, 41876, 49468, 50609, 54137, 57239

Another way to phrase the property of members of this sequence is to say that the addition of the product and sum of the prime factors of \(n\) is equal to the addition of the product and sum of the prime factors of \(n+1\). Let's take 63 as an example:$$ \begin{align} &63 = 3 \times 3 \times 7 \\ &\underbrace{3 \times 3 \times 7}_{\text{product of prime factors}} + \underbrace{3 + 3 +7}_{\text{sum of prime factors}} = 76 \\ \\ &64 =2 \times 2 \times 2 \times 2 \times 2 \times 2 \\ &\underbrace{2 \times 2 \times 2 \times 2 \times 2 \times 2}_{\text{product of prime factors}}+ \underbrace{2+2+2+2+2+2}_{\text{sum of prime factors}} = 76 \end{align} $$This got me thinking about pairs of consecutive numbers that have the same sum of their distinct prime factors. To my surprise, this led me to the famous Ruth-Aaron numbers that I looked at in a post titled Ruth-Aaron Pairs and eRAPs on Monday the 29th of April 2019. The numbers are so called because 714 is Babe Ruth's lifetime home run record and Hank Aaron's 715th home run broke this record. 714 and 715 have the same sum of prime divisors, taken with multiplicity. These numbers constitute OEIS A039752:


 A039752

Ruth-Aaron numbers (2): sum of prime divisors of \(n\) = sum of prime divisors of \(n\)+1 (both taken with multiplicity).



The initial members are (permalink):

5, 8, 15, 77, 125, 714, 948, 1330, 1520, 1862, 2491, 3248, 4185, 4191, 5405, 5560, 5959, 6867, 8280, 8463, 10647, 12351, 14587, 16932, 17080, 18490, 20450, 24895, 26642, 26649, 28448, 28809, 33019, 37828, 37881, 41261, 42624, 43215, 44831, 44891, 47544, 49240

If multiplicity is ignored and only distinct prime factors are considered, then we have OEIS A006145:


 A006145

Ruth-Aaron numbers (1): sum of prime divisors of \(n\) = sum of prime divisors of \(n\)+1.



The initial members are (permalink):

5, 24, 49, 77, 104, 153, 369, 492, 714, 1682, 2107, 2299, 2600, 2783, 5405, 6556, 6811, 8855, 9800, 12726, 13775, 18655, 21183, 24024, 24432, 24880, 25839, 26642, 35456, 40081, 43680, 48203, 48762, 52554, 61760, 63665, 64232, 75140, 79118, 95709, 106893, 109939

Looking the 714 and 715 it can be seen that:$$ \begin{align} 714 &= 2 \times 3 \times 7 \times 17 \\ 2+3+7+17 &= 29 \\715 &= 5 \times 11 \times 13\\ 5+11+13 &= 29 \end{align}$$The two sequences will share terms that are square-free (like 714) but otherwise differ. For example, the second term of the previous sequence is 24 with distinct prime factors of 2 and 3, adding to 5. The next term 25 has only one distinct prime factor, 5, and thus 24 qualifies for inclusion in the sequence but it is not a member of OEIS  A039752.

In my blog post Ruth-Aaron Pairs and eRAPs, mentioned earlier, the eRAP refers to an extension, proposed by Abhiram R. Devesh, of Ruth-Aaron Pairs (thus called eRAP) where two consecutive numbers form a pair if the sums of their prime factors are consecutive. 

These numbers form OEIS  A228126:


 A228126

Sum of prime divisors of \(n\) (with repetition) is one less than the sum of prime divisors (with repetition) of \(n\)+1.



The initial members are:

2, 3, 4, 9, 20, 24, 98, 170, 1104, 1274, 2079, 2255, 3438, 4233, 4345, 4716, 5368, 7105, 7625, 10620, 13350, 13775, 14905, 20220, 21385, 23408, 25592, 26123, 28518, 30457, 34945, 35167, 38180, 45548, 49230, 51911, 52206, 53456, 56563, 61456, 65429, 66585

For example, let's take 24:$$ \begin{align} 24 &= 2 \times 2 \times 2 \times 3 \\2+2+2+3& =9\\25 &=5 \times 5\\5+5&=10 \end{align}$$Since 10 is one more than 9, 24 qualifies for membership in the sequence.

In my earlier post, I spend some time looking at triples comprising three consecutive numbers as well as pairs comprising two consecutive numbers and so it's worth looking back at that post for details about that. Referring back to OEIS A020700, it's likely that triples exist there as well but they would be rather be comprised of quite large large numbers. It can be noted also that all of these sequences are base-independent.

Thursday, 1 February 2024

Revisiting Sums and Differences of Two Pronic Numbers

On Monday the 6th of February 2023, I made a post titled Even Numbers as Sum and Differences of Two Pronic Numbers and concluded it by stating the following:

This post is just meant as an initial investigation into this topic and it would be useful to expand the investigation to include all even numbers in the range up to about 40000.

In this post, I'd like to explore the conjecture that all even numbers can be expressed, at least in one way, as the sum or difference of two pronic numbers. In my original post, I showed that not all even numbers could be expressed as a sum of two pronic numbers nor as a difference of two pronic numbers. However, I never took it further and that's what I'd like to do in this post.

What's prompted this post is one of the properties of the number associated with my diurnal age today: 27332. It is one of those rare numbers that can be expressed as a sum of two pronic numbers in six different ways:

  • 27332 is the sum of 27060 and 272
  • 27332 is the sum of 26732 and 600
  • 27332 is the sum of 25440 and 1892
  • 27332 is the sum of 21170 and 6162
  • 27332 is the sum of 20022 and 7310
  • 27332 is the sum of 17030 and 10302
Let's recall that pronic numbers are of the form \(n \times (n+1) \) for \(n \geq 1\). Up to 40,000, these numbers are:

2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462, 506, 552, 600, 650, 702, 756, 812, 870, 930, 992, 1056, 1122, 1190, 1260, 1332, 1406, 1482, 1560, 1640, 1722, 1806, 1892, 1980, 2070, 2162, 2256, 2352, 2450, 2550, 2652, 2756, 2862, 2970, 3080, 3192, 3306, 3422, 3540, 3660, 3782, 3906, 4032, 4160, 4290, 4422, 4556, 4692, 4830, 4970, 5112, 5256, 5402, 5550, 5700, 5852, 6006, 6162, 6320, 6480, 6642, 6806, 6972, 7140, 7310, 7482, 7656, 7832, 8010, 8190, 8372, 8556, 8742, 8930, 9120, 9312, 9506, 9702, 9900, 10100, 10302, 10506, 10712, 10920, 11130, 11342, 11556, 11772, 11990, 12210, 12432, 12656, 12882, 13110, 13340, 13572, 13806, 14042, 14280, 14520, 14762, 15006, 15252, 15500, 15750, 16002, 16256, 16512, 16770, 17030, 17292, 17556, 17822, 18090, 18360, 18632, 18906, 19182, 19460, 19740, 20022, 20306, 20592, 20880, 21170, 21462, 21756, 22052, 22350, 22650, 22952, 23256, 23562, 23870, 24180, 24492, 24806, 25122, 25440, 25760, 26082, 26406, 26732, 27060, 27390, 27722, 28056, 28392, 28730, 29070, 29412, 29756, 30102, 30450, 30800, 31152, 31506, 31862, 32220, 32580, 32942, 33306, 33672, 34040, 34410, 34782, 35156, 35532, 35910, 36290, 36672, 37056, 37442, 37830, 38220, 38612, 39006, 39402, 39800

Let's look at numbers in the region of 27332 to get an idea of what's going on (permalink):

  • 27334 is the difference of 27390 and 56
  • 27334 is the difference of 45156 and 17822

  • 27336 is the sum of 26406 and 930
  • 27336 is the difference of 28392 and 1056
  • 27336 is the difference of 56406 and 29070
  • 27336 is the difference of 86142 and 58806
  • 27336 is the difference of 338142 and 310806
  • 27336 is the difference of 660156 and 632820
  • 27336 is the difference of 2932656 and 2905320

  • 27338 is the difference of 46724060 and 46696722
    
    
  • 27340 is the difference of 480942 and 453602

  • 27342 is the difference of 27722 and 380
  • 27342 is the sum of 26082 and 1260
  • 27342 is the difference of 29412 and 2070
  • 27342 is the sum of 22650 and 4692
  • 27342 is the difference of 35532 and 8190
  • 27342 is the difference of 37442 and 10100
  • 27342 is the difference of 61752 and 34410
  • 27342 is the difference of 63252 and 35910
  • 27342 is the difference of 92112 and 64770
  • 27342 is the difference of 120062 and 92720
  • 27342 is the difference of 208392 and 181050
  • 27342 is the difference of 437582 and 410240
  • 27342 is the difference of 590592 and 563250
  • 27342 is the difference of 967272 and 939930
  • 27342 is the difference of 2321052 and 2293710
  • 27342 is the difference of 3827892 and 3800550

  • 27344 is the sum of 23562 and 3782
  • 27344 is the sum of 16002 and 11342
  • 27344 is the difference of 743906 and 716562

  • 27346 is the difference of 30102 and 2756
  • 27346 is the difference of 31506 and 4160
  • 27346 is the difference of 400056 and 372710
  • 27346 is the difference of 1558752 and 1531406

  • 27348 is the difference of 27390 and 42
  • 27348 is the difference of 29070 and 1722
  • 27348 is the difference of 80940 and 53592
  • 27348 is the difference of 115260 and 87912
  • 27348 is the difference of 1312170 and 1284822
At first I couldn't find a sum or difference for 27338 until I extended the list of pronic numbers to 10,000 x 10,001. My initial analysis suggests that it is possible to write any even number as the sum or difference of two pronic numbers. Not surprisingly differences seem to predominate.

At first I thought that 27322 was anomalous in that it is the sum of six different pairs of pronic numbers but no differences. However, extending the list of pronic numbers as before I found that it is also the difference of 11686142 and 11658810. There may well be a formal mathematical proof of my conjecture but my approach so far is purely empirical. Put in formal mathematical terms, I could state my conjecture as follows:

For any even positive integer \(n \gt 2\), there exists pronic numbers \(p \times (p+1) \) and \(q \times (q+1) \) with \(p \gt q\) such that:$$ \begin{align} n &=p \times (p+1) +q \times (q+1) \\ &=p^2+q^2 +p+q \end{align}$$or$$ \begin{align} n &=p \times (p+1) -q \times (q+1) \\ &= p^2-q^2+p-q \\ &= (p+q)(p-q) + p-q \\ &= (p+q)(p-q+1) \end{align}$$
As a final note, let's not forget that every pronic number is twice a triangular number since the formula for a triangular \(T_n\) number is:$$ \begin{align} T_n &= \sum_{k=1}^n k \\ &= 1+2+3 \dots n \\ &=\frac{n \times (n+1)}{2} \\&= \binom{n}{2} \end{align} $$Thus many of the properties of triangular numbers would be shared by pronic numbers.

Wednesday, 22 February 2023

Modest Numbers

Modest numbers are a category of numbers that I haven't paid a great deal of attention to. They are defined by Numbers Aplenty in the following manner:

A number \(n\) is called modest if its digits can be separated into two numbers \(a\) and \(b\) such that \(n\) divided by \(b\) gives \(a\) as remainder.

The reason its came to my attention is that Julian Day Number 2459999 is approaching and it has the property of being a modest number because 9999 divides 2459999 to give 245 or to put it in another format:$$2459999 \! \! \mod 99999 \equiv 245$$I developed an algorithm in SageMath to determine all the modest numbers in a given range. Here are the modest numbers in the range up to 40,000 (permalink), constituting 2.25% of the range:

13, 19, 23, 26, 29, 39, 46, 49, 59, 69, 79, 89, 103, 109, 111, 133, 199, 203, 206, 209, 211, 218, 222, 233, 266, 299, 309, 311, 327, 333, 399, 406, 409, 411, 412, 418, 422, 433, 436, 444, 466, 499, 509, 511, 515, 533, 545, 555, 599, 609, 611, 618, 622, 627, 633, 654, 666, 699, 709, 711, 721, 733, 763, 777, 799, 809, 811, 812, 818, 822, 824, 833, 836, 844, 866, 872, 888, 899, 911, 927, 933, 981, 999, 1003, 1009, 1011, 1015, 1018, 1022, 1027, 1030, 1033, 1037, 1045, 1055, 1066, 1090, 1099, 1111, 1133, 1199, 1218, 1222, 1227, 1233, 1236, 1244, 1254, 1266, 1299, 1333, 1339, 1399, 1418, 1421, 1422, 1433, 1442, 1463, 1466, 1477, 1499, 1527, 1533, 1545, 1555, 1599, 1618, 1622, 1624, 1633, 1636, 1644, 1648, 1666, 1672, 1688, 1699, 1733, 1751, 1799, 1822, 1827, 1833, 1854, 1866, 1881, 1899, 1933, 1957, 1999, 2003, 2006, 2009, 2018, 2022, 2027, 2030, 2033, 2036, 2037, 2044, 2045, 2054, 2055, 2060, 2066, 2074, 2090, 2099, 2111, 2127, 2133, 2163, 2177, 2199, 2222, 2233, 2266, 2299, 2333, 2369, 2399, 2427, 2433, 2436, 2444, 2454, 2466, 2472, 2488, 2499, 2533, 2545, 2555, 2575, 2599, 2633, 2639, 2666, 2678, 2699, 2733, 2781, 2799, 2833, 2836, 2842, 2844, 2863, 2866, 2877, 2884, 2899, 2933, 2987, 2999, 3009, 3027, 3033, 3037, 3045, 3054, 3055, 3066, 3081, 3090, 3099, 3111, 3133, 3193, 3199, 3233, 3236, 3244, 3248, 3266, 3272, 3288, 3296, 3299, 3333, 3399, 3451, 3466, 3499, 3545, 3555, 3563, 3577, 3599, 3644, 3654, 3666, 3681, 3699, 3799, 3857, 3866, 3899, 3999, 4006, 4009, 4012, 4018, 4027, 4036, 4037, 4044, 4045, 4054, 4055, 4060, 4066, 4072, 4074, 4088, 4090, 4099, 4108, 4111, 4148, 4199, 4222, 4254, 4263, 4266, 4277, 4299, 4333, 4399, 4444, 4466, 4499, 4555, 4581, 4599, 4666, 4669, 4699, 4799, 4854, 4866, 4872, 4888, 4899, 4963, 4977, 4999, 5009, 5015, 5027, 5037, 5045, 5055, 5066, 5075, 5090, 5099, 5111, 5135, 5185, 5199, 5266, 5278, 5299, 5333, 5399, 5466, 5481, 5499, 5555, 5599, 5663, 5666, 5672, 5677, 5684, 5688, 5699, 5799, 5866, 5887, 5899, 5999, 6009, 6018, 6027, 6037, 6054, 6066, 6074, 6081, 6090, 6099, 6111, 6162, 6199, 6222, 6266, 6293, 6299, 6333, 6377, 6381, 6399, 6466, 6472, 6488, 6496, 6499, 6599, 6666, 6699, 6799, 6899, 6999, 7009, 7021, 7027, 7037, 7063, 7077, 7090, 7099, 7111, 7189, 7199, 7259, 7281, 7288, 7299, 7333, 7399, 7499, 7599, 7699, 7777, 7799, 7899, 7999, 8009, 8012, 8018, 8024, 8027, 8036, 8037, 8054, 8072, 8074, 8088, 8090, 8099, 8108, 8111, 8148, 8199, 8216, 8222, 8296, 8299, 8333, 8399, 8444, 8499, 8599, 8666, 8699, 8799, 8888, 8899, 8999, 9027, 9037, 9081, 9099, 9111, 9199, 9243, 9299, 9333, 9399, 9499, 9599, 9699, 9799, 9899, 9999, 10003, 10009, 10011, 10015, 10018, 10027, 10030, 10033, 10037, 10045, 10054, 10074, 10090, 10099, 10101, 10111, 10135, 10185, 10222, 10270, 10303, 10333, 10370, 10555, 10666, 10909, 10999, 11027, 11033, 11037, 11099, 11111, 11297, 11333, 11407, 11999, 12018, 12027, 12036, 12037, 12054, 12074, 12081, 12108, 12111, 12148, 12162, 12222, 12324, 12333, 12444, 12666, 12999, 13027, 13037, 13039, 13111, 13117, 13333, 13351, 13481, 13999, 14018, 14021, 14027, 14037, 14042, 14054, 14063, 14074, 14111, 14126, 14189, 14222, 14259, 14333, 14378, 14518, 14666, 14777, 14999, 15027, 15037, 15045, 15081, 15111, 15135, 15185, 15333, 15405, 15555, 15999, 16018, 16024, 16027, 16036, 16037, 16048, 16054, 16072, 16074, 16108, 16111, 16144, 16148, 16216, 16222, 16296, 16333, 16432, 16444, 16592, 16666, 16888, 16999, 17027, 17037, 17051, 17111, 17153, 17333, 17459, 17629, 17999, 18027, 18037, 18054, 18074, 18081, 18111, 18162, 18222, 18243, 18333, 18486, 18666, 18999, 19027, 19037, 19057, 19111, 19171, 19333, 19513, 19703, 19999, 20003, 20006, 20009, 20011, 20018, 20022, 20027, 20030, 20033, 20036, 20037, 20045, 20054, 20060, 20066, 20074, 20090, 20099, 20101, 20108, 20111, 20135, 20148, 20180, 20185, 20198, 20202, 20222, 20270, 20303, 20333, 20370, 20444, 20540, 20555, 20606, 20666, 20740, 20909, 20999, 21027, 21037, 21063, 21081, 21111, 21189, 21259, 21333, 21567, 21777, 21818, 21999, 22027, 22033, 22037, 22054, 22066, 22074, 22099, 22111, 22198, 22222, 22297, 22333, 22407, 22594, 22666, 22814, 22999, 23027, 23037, 23069, 23111, 23207, 23333, 23621, 23851, 23999, 24027, 24036, 24037, 24054, 24072, 24074, 24081, 24108, 24111, 24148, 24162, 24216, 24222, 24296, 24324, 24333, 24444, 24648, 24666, 24888, 24999, 25027, 25037, 25045, 25075, 25111, 25135, 25185, 25225, 25333, 25555, 25675, 25925, 25999, 26027, 26037, 26039, 26054, 26074, 26078, 26111, 26117, 26222, 26234, 26333, 26351, 26481, 26666, 26702, 26962, 26999, 27037, 27081, 27111, 27243, 27333, 27729, 27999, 28036, 28037, 28042, 28054, 28063, 28074, 28084, 28108, 28111, 28126, 28148, 28189, 28222, 28252, 28259, 28333, 28378, 28444, 28518, 28666, 28756, 28777, 28999, 29037, 29087, 29111, 29261, 29333, 29783, 29999, 30009, 30011, 30027, 30033, 30037, 30045, 30054, 30074, 30081, 30090, 30099, 30101, 30111, 30135, 30162, 30185, 30222, 30270, 30297, 30303, 30333, 30370, 30405, 30555, 30666, 30810, 30909, 30999, 31037, 31093, 31111, 31279, 31333, 31837, 31999, 32036, 32037, 32048, 32054, 32072, 32074, 32096, 32108, 32111, 32144, 32148, 32216, 32222, 32288, 32296, 32333, 32432, 32444, 32592, 32666, 32727, 32864, 32888, 32999, 33037, 33081, 33099, 33111, 33297, 33333, 33407, 33891, 33999, 34037, 34051, 34054, 34074, 34102, 34111, 34153, 34222, 34306, 34333, 34459, 34629, 34666, 34918, 34999, 35037, 35045, 35063, 35105, 35111, 35135, 35185, 35189, 35259, 35315, 35333, 35555, 35777, 35945, 35999, 36037, 36054, 36074, 36081, 36108, 36111, 36148, 36162, 36222, 36243, 36324, 36333, 36444, 36486, 36666, 36972, 36999, 37111, 37333, 37999, 38054, 38057, 38074, 38111, 38114, 38171, 38222, 38333, 38342, 38513, 38666, 38703, 38999, 39081, 39111, 39117, 39333, 39351, 39481, 39999

Even though the first three modest numbers are prime, the prime modest numbers occupy only 0.27% of the range (108 numbers). Consecutive modest numbers are few and far between. Here are the pairs of such numbers up to 40,000:

411 and 412
811 and 812
1421 and 1422
2036 and 2037
2044 and 2045
2054 and 2055
3054 and 3055
4036 and 4037
4044 and 4045
4054 and 4055
8036 and 8037
12036 and 12037
16036 and 16037
20036 and 20037
24036 and 24037
28036 and 28037
32036 and 32037

No triplets have been found as far as I know.

It's of interest to consider the frequency of final digits of modest numbers.

Here is the breakdown of final digits in the range up to 100000 (permalink):

There are a total of 1728 modest numbers:

0 --> 67
1 --> 218
2 --> 151
3 --> 219
4 --> 161
5 --> 128
6 --> 172
7 --> 159
8 --> 144
9 --> 309

Clearly numbers ending in the digit 9 predominate.

CONTINUED IN NEXT POST DUE TO TECHNICAL DIFFICULTIES