Wednesday, 30 July 2025

A Well-Known Legendre Prime-Producing Polynomial

 Here is what Gemini had to say about the prime-producing polynomial \( 2 k^2+29\):

The polynomial \( 2 k^2+29\) is a well-known example of a prime-producing polynomial, often associated with the French mathematician Adrien-Marie Legendre. Here's a breakdown of its discovery, usage, and prime-producing potential:

Discovery:

  • Adrien-Marie Legendre (1752-1833) is credited with the discovery of the polynomial \( 2  k^2+29\). He published this result in his work "Essai sur la théorie des nombres" in 1798.

  • This came in the wake of significant work on prime-generating polynomials, notably Euler's polynomial \(k^2+k+41\), which generates primes for 40 consecutive integer values. Legendre's work further explored this fascinating property in different polynomial forms.

Usage and Significance:

  • Illustrates Prime-Generating Properties: While no non-constant polynomial with integer coefficients can generate only prime numbers for all integer values (this has been proven), polynomials like \( 2 k^2+29\) are significant because they produce a surprisingly long sequence of prime numbers for consecutive integer inputs.

  • Connection to Class Number Theory: The behavior of such prime-producing quadratic polynomials is deeply connected to the theory of class numbers in imaginary quadratic fields. The fact that \( 2 k^2+29\) (and other similar polynomials like Euler's \(k^2+k+41\)) produce so many primes is not a coincidence but is tied to specific properties of the corresponding quadratic fields.

  • Educational and Recreational Mathematics: These polynomials are frequently used in number theory courses and popular science to demonstrate the elusive nature of prime number distribution and the intriguing patterns that can emerge. They serve as excellent examples to explore the question of "prime-generating formulas."

  • In Popular Culture: The sequence of primes generated by \( 2 k^2+29\) has even appeared in popular culture, such as in Ken Follett's novel "Code to Zero."

Prime-Producing Potential:

  • The polynomial \( \text{P}(k)= 2 k^2+29 \) generates prime numbers for a remarkable number of consecutive integer values of \(k\). Specifically, it produces primes for \(k=0,1,2, \dots 28\). This means it generates 29 consecutive primes starting from .

  • Let's list the first few:

    • \( \text{P}(0)=2 \times 0^2+29=29 \) (prime)

    • \( \text{P}(1)=2 \times 1^2+29=31\) (prime)

    • \( \text{P}(2)=2 \times 2^2+29=37 \) (prime)

    • \( \text{P}(3)=2 \times 3^2+29=47 \) (prime)

    • ...and so on, up to \( \text{P}(28) \).

  • For \(k=29\)$$\text{P}(29)=2 \times 29^2+29=29 \, (2×29+1)=29 \times 59$$which is a composite number. This illustrates the general principle that no such polynomial can produce primes indefinitely.

In summary, Legendre's polynomial \( 2 k^2+29\) is a notable discovery in number theory, demonstrating an impressive string of prime outputs for consecutive integer inputs. Its significance lies in its historical context alongside other prime-generating polynomials like Euler's, its connection to deeper number theoretic concepts like class numbers, and its role as a compelling example in the study of prime numbers.

The polynomial popped up because of a reference to it in OEIS A241554: composite numbers of the form \(2  k^2 + 29\). The number associated with my diurnal age today, 27877, is a member of this sequence:$$ \begin{align} \text{If }k &=118 \\ 2k^2+29 &= 2 \times 118^2+29 \\ &= 27877 \\ &=61 \times 457 \end{align}$$When this polynomial is not busy churning out primes, it is busy churning out semiprimes. In fact, it is only when \(k=185\) that we get a number that is not a prime or a semiprime:$$\begin{align} \text{If }k &=185 \\ 2k^2+29 &= 2 \times 185^2+29 \\ &= 68479 \\ &=31 \times 47^2 \end{align}$$Follow this permalink to generate a table of these numbers and their factors. Here is a list of the members of OEIS A241554 between 1 and 40000:

1711, 1829, 2077, 2479, 3071, 3901, 5029, 6527, 6757, 7471, 7967, 8479, 10397, 10981, 11581, 14141, 15167, 15517, 15871, 16591, 16957, 17701, 18079, 18847, 19631, 20837, 22927, 23791, 25567, 26941, 27877, 28829, 29797, 30287, 31279, 31781, 32287, 35941, 38117

The table below shows the factorisations of the previous numbers as well as the corresponding \(k\) values:

  k     2*k^2+29   factors

  29    1711       29 * 59
  30    1829       31 * 59
  32    2077       31 * 67
  35    2479       37 * 67
  39    3071       37 * 83
  44    3901       47 * 83
  50    5029       47 * 107
  57    6527       61 * 107
  58    6757       29 * 233
  61    7471       31 * 241
  63    7967       31 * 257
  65    8479       61 * 139
  72    10397      37 * 281
  74    10981      79 * 139
  76    11581      37 * 313
  84    14141      79 * 179
  87    15167      29 * 523
  88    15517      59 * 263
  89    15871      59 * 269
  91    16591      47 * 353
  92    16957      31 * 547
  94    17701      31 * 571
  95    18079      101 * 179
  97    18847      47 * 401
  99    19631      67 * 293
  102   20837      67 * 311
  107   22927      101 * 227
  109   23791      37 * 643
  113   25567      37 * 691
  116   26941      29 * 929
  118   27877      61 * 457
  120   28829      127 * 227
  122   29797      83 * 359
  123   30287      31 * 977
  125   31279      31 * 1009
  126   31781      61 * 521
  127   32287      83 * 389
  134   35941      127 * 283
  138   38117      47 * 811

There are 103 primes in the range up to 40000 that are generated by this polynomial. These start with \(k=0\):

29, 31, 37, 47, 61, 79, 101, 127, 157, 191, 229, 271, 317, 367, 421, 479, 541, 607, 677, 751, 829, 911, 997, 1087, 1181, 1279, 1381, 1487, 1597, 1951, 2207, 2341, 2621, 2767, 2917, 3229, 3391, 3557, 3727, 4079, 4261, 4447, 4637, 4831, 5231, 5437, 5647, 5861, 6079, 6301, 6991, 7229, 7717, 8221, 8741, 9007, 9277, 9551, 9829, 10111, 10687, 11279, 11887, 12197, 12511, 12829, 13151, 13477, 13807, 14479, 14821, 16229, 17327, 18461, 19237, 20029, 20431, 21247, 21661, 22079, 22501, 23357, 24229, 24671, 25117, 26021, 26479, 27407, 28351, 29311, 30781, 32797, 33311, 33829, 34351, 34877, 35407, 36479, 37021, 37567, 38671, 39229, 39791

Tuesday, 29 July 2025

Split and Add

There's a section in the Numbers Aplenty web page that divides a number into two smaller numbers and then adds the two together to form a new number with some interesting property. For example, the number associated with my diurnal age today is 27876 and Numbers Aplenty has this to say about it:

It can be divided in two parts (27 and 876) that added together give the 42nd triangular number, specifically: 

\(27876 \rightarrow 27 + 876 = 903 = \text{T}_{42}\) 

Normally I ignore this section of the page as the operation seems a little contrived and this was initially the case yesterday when I was searching for interesting properties associated with 27875. In frustration, I turned to Gemini for help and this is the rather long-winded prompt that I gave it:

I'm trying to find something of mathematical interest about the number 27875. I've looked at the entries for the number in the OEIS (Online Encyclopedia of Integer Sequences) at oeis.org and also the information located at Numbers Aplenty (https://www.numbersaplenty.com/27875). These are my usual sources of information about the number but I'm not satisfied with the information that I found there. I'm looking for some property of the number that is quirky, curious or unique. You'll have to apply some lateral thinking and creativity to come up with such a property. Remember that the property must be mathematical but it can fall into the category of recreational mathematics rather than academic mathematics. The number may have significance or importance in an area outside of mathematics such as physics, geography, demographics etc.

Here was Gemini's response:

A particularly curious property of 27875 emerges from a simple, recreational manipulation of its digits. The number 27875 can be split into two parts: the number formed by the first three digits, 278, and the number formed by the last two digits, 75. When you add these two parts together, you get a special result:

\(278+75=353\)

The sum, 353, is a palindromic prime number—it reads the same forwards and backwards, and its only divisors are 1 and itself. palindromic primes are relatively uncommon, and finding one through this kind of "split-sum" operation is a quirky feature.


Diving Deeper 🧐

The property becomes even more unique when we look at the prime number index.

  • The number 353 is the 71st prime number.

  • The index itself, 71, is also a prime number.

This makes 353 a prime index prime, adding another layer of mathematical interest to the result derived from 27875. 

So Gemini came up with a property of the number that was already on the Numbers Aplenty web page but it did add the additional information that the palindrome was prime and that this prime had a prime index. This got me thinking as to what other five digit numbers had the property that they could be split into two parts and have the two parts add together to form a prime number with a prime index.

I developed an algorithm (permalink) to find such numbers in the range from 27875 to 40000. It turns out that there are 83 such numbers with one of them (29162) able to be split in two different ways:$$ \begin{align} 29162 &\rightarrow 29+162 =191 = \text{P}_{43} \\ 29162 &\rightarrow 291+62 =353 = \text{P}_{71} \end{align}$$Here is a list of the 83 numbers:

27875, 27892, 27974, 28163, 28172, 28271, 28325, 28469, 28568, 28667, 28766, 28769, 28865, 28891, 28964, 29162, 29162, 29261, 29324, 29459, 29558, 29657, 29756, 29768, 29855, 29954, 31142, 31241, 31322, 31439, 31538, 31637, 31736, 31766, 31835, 31888, 31934, 32132, 32159, 32231, 32321, 32429, 32528, 32627, 32726, 32765, 32825, 32887, 32924, 33122, 33158, 33221, 33419, 33518, 33617, 33716, 33764, 33815, 33886, 33914, 34112, 34157, 34211, 34319, 34763, 34885, 35156, 35318, 35762, 35884, 36155, 36317, 36761, 36883, 37154, 37316, 37882, 38153, 38315, 38759, 38881, 39152, 39314, 39758

The details are as follows:

number   first   second   palindrome   prime index

  27875    278     75       353          71
  27892    27      892      919          157
  27974    279     74       353          71
  28163    28      163      191          43
  28172    281     72       353          71
  28271    282     71       353          71
  28325    28      325      353          71
  28469    284     69       353          71
  28568    285     68       353          71
  28667    286     67       353          71
  28766    287     66       353          71
  28769    28      769      797          139
  28865    288     65       353          71
  28891    28      891      919          157
  28964    289     64       353          71
  29162    29      162      191          43
  29162    291     62       353          71
  29261    292     61       353          71
  29324    29      324      353          71
  29459    294     59       353          71
  29558    295     58       353          71
  29657    296     57       353          71
  29756    297     56       353          71
  29768    29      768      797          139
  29855    298     55       353          71
  29954    299     54       353          71
  31142    311     42       353          71
  31241    312     41       353          71
  31322    31      322      353          71
  31439    314     39       353          71
  31538    315     38       353          71
  31637    316     37       353          71
  31736    317     36       353          71
  31766    31      766      797          139
  31835    318     35       353          71
  31888    31      888      919          157
  31934    319     34       353          71
  32132    321     32       353          71
  32159    32      159      191          43
  32231    322     31       353          71
  32321    32      321      353          71
  32429    324     29       353          71
  32528    325     28       353          71
  32627    326     27       353          71
  32726    327     26       353          71
  32765    32      765      797          139
  32825    328     25       353          71
  32887    32      887      919          157
  32924    329     24       353          71
  33122    331     22       353          71
  33158    33      158      191          43
  33221    332     21       353          71
  33419    334     19       353          71
  33518    335     18       353          71
  33617    336     17       353          71
  33716    337     16       353          71
  33764    33      764      797          139
  33815    338     15       353          71
  33886    33      886      919          157
  33914    339     14       353          71
  34112    341     12       353          71
  34157    34      157      191          43
  34211    342     11       353          71
  34319    34      319      353          71
  34763    34      763      797          139
  34885    34      885      919          157
  35156    35      156      191          43
  35318    35      318      353          71
  35762    35      762      797          139
  35884    35      884      919          157
  36155    36      155      191          43
  36317    36      317      353          71
  36761    36      761      797          139
  36883    36      883      919          157
  37154    37      154      191          43
  37316    37      316      353          71
  37882    37      882      919          157
  38153    38      153      191          43
  38315    38      315      353          71
  38759    38      759      797          139
  38881    38      881      919          157
  39152    39      152      191          43
  39314    39      314      353          71
  39758    39      758      797          139

29162 occurs 2 times
29162 occurs 2 times

Friday, 25 July 2025

27872: Another Palindromic Number


For the last 800 days they've been coming around every 100 days and today marks yet another palindromic day as I turn 27872 days old. I've mentioned one of the properties of this number in my post titled Difference of Two Cubic Numbers. I noted that this palindrome is a difference of two cubes:$$27872=38^3-30^3$$Another property of this palindrome is that it is the sum of two prime palindromes in two different ways:$$ \begin{align} 27872 &= 11311 + 16561\\ &=12421 + 15451 \end{align}$$In the range up to 40000, there are only 25 palindromes with this property and these are the initial terms of OEIS A356854:

282, 484, 858, 888, 21912, 22722, 23832, 24642, 25752, 26662, 26762, 26862, 26962, 27672, 27772, 27872, 27972, 28482, 28782, 28882, 28982, 29692, 29792, 29892, 29992

27872 also has the property that it is the smallest palindrome with exactly seven prime factors, counted with multiplicity. This qualifies it for membership in OEIS A076886: smallest palindrome with exactly \(n\) prime factors (counted with multiplicity). See Figure 1 where the initial terms with their \(n\) values are listed.

Figure 1

In 100 days I'll be able to celebrate 27972 that's also a member of OEIS A356854. After that, it is only 31 days to the next palindromic day: 30003.

Triangular Roots

While everyone has heard of a "square root", I for one had not heard of a "triangular root" defined for a number \(x\) as:$$ \sqrt [\strut \triangle] {x} = \frac{-1 \pm \sqrt{1+8x}}{2}$$Suppose we want to find the triangular root of 6. This gives:$$  \begin{align} \sqrt [\strut \triangle] {6} &= \frac{-1 \pm \sqrt{1+8 \times 6}}{2}\\  \\ &=  \frac{-1 \pm \sqrt{1+48}}{2} \\  \\ &= \frac{-1 \pm \sqrt{49}}{2} \\  \\ &= \frac{-1 \pm 7}{2}\\ \\ &= 3 \text{ } \text{  or} -4 \end{align}$$The formula arises from the definition of a triangular number \(x\) and the solution of the resulting quadratic equation:$$ \begin{align}  \frac{n \, (n+1)}{2} &= x \\ \\ n^2 + n -2x &=0 \\ \\  n &= \frac{-1 \pm \sqrt{1+8x}}{2} \end{align} $$This method is no different to what we do when finding the square root of a number where we have:$$ \begin{align} n^2 &= x \\ n &= \pm \sqrt{x}  \end{align}$$By way of comparison it can be noted that triangular roots are only real if \(x \geq -1/8 \) whereas square roots are only real if \(x \geq 0 \). I can thank Dr. Barker's YouTube video for prompting this post. 

Figure 1 shows the situation for \(6 = \dfrac{n \, (n+1)}{2}\) where \(n=-4 \text{ or } 3\).


Figure 1:  -4 and 3 are the values of \( \sqrt [\strut \triangle] {6}\)

Difference of Two Cubic Numbers

I'm surprised that I've not dealt with this topic before but as far as I can tell I haven't. The topic in question is numbers that are the difference of two cubes, or more specifically the difference of two positive cubes. My diurnal age today is 27872, a palindrome, with the property that:$$27872 = 38^3-30^3$$It's easy enough to develop an algorithm to determine all such numbers in the range up to 40000 and the total is 825. However, if we consider only those numbers equal to or greater than 27872, then only 188 numbers qualify. They are (permalink):

27872, 27937, 28063, 28415, 28460, 28519, 28568, 28656, 28672, 28701, 28737, 28791, 28828, 28854, 29051, 29062, 29078, 29080, 29107, 29279, 29393, 29402, 29448, 29528, 29575, 29617, 29666, 29701, 29727, 29735, 29763, 29764, 29783, 29790, 30016, 30024, 30043, 30105, 30248, 30301, 30312, 30483, 30571, 30708, 30807, 30907, 30970, 31024, 31031, 31040, 31085, 31106, 31213, 31228, 31232, 31304, 31437, 31519, 31768, 31806, 31841, 31869, 31976, 32039, 32137, 32227, 32256, 32319, 32425, 32445, 32464, 32465, 32552, 32562, 32643, 32704, 32741, 32760, 32761, 32767, 32832, 32851, 32858, 32920, 32949, 32984, 33077, 33193, 33336, 33391, 33472, 33614, 33724, 33740, 33752, 33875, 34027, 34047, 34209, 34391, 34489, 34531, 34606, 34658, 34669, 34784, 34875, 34902, 34930, 34937, 35008, 35028, 35163, 35189, 35208, 35315, 35317, 35425, 35576, 35594, 35721, 35812, 35873, 35910, 35929, 35936, 35971, 36008, 36016, 36153, 36253, 36297, 36316, 36504, 36506, 36560, 36631, 36632, 36785, 36829, 37000, 37043, 37107, 37296, 37297, 37367, 37395, 37448, 37449, 37576, 37648, 37962, 37969, 37973, 38017, 38142, 38151, 38285, 38304, 38402, 38486, 38528, 38575, 38619, 38647, 38656, 38779, 38792, 38961, 39004, 39088, 39130, 39179, 39240, 39247, 39277, 39296, 39303, 39331, 39368, 39500, 39611, 39636, 39797, 39807, 39815, 39816, 39823 (see OEIS A181123)

Of these 188, there are five numbers that can be expressed as a difference of two cubes in more that one way. These are 27937, 28063, 34209, 35208 and 35929. The details are as follows:$$ \begin{align} 27937 &= 33^3- 20^3 \\ &=97^3- 96^3 \\ 28063 &= 31^3- 12^3 \\ &=40^3- 33^3 \\34209 &= 33^3- 12^3 \\ &=40^3- 31^3 \\ 35208 &= 33^3- 9^3 \\ &= 34^3- 16^3 \\ 35929 &= 33^3- 2^3 \\ &=34^3- 15^3 \end{align}$$Notice that 27937 is a difference of successive cubes but, because it is not prime, it cannot be a Cuban prime. The only Cuban prime in the range is 33391where:$$33391=106^3-105^3$$I've dealt with this category of primes in my blog post titled Cuban Primes way back in July of 2016.

Wednesday, 23 July 2025

Shuffling Digits

Let's consider all those numbers in base 10 that retain their digits when changed into another number base. In other words, the digits of the number in base 10 are simply shuffled about. Let's start with base 9. In the range up to 40000 and ignoring single digit numbers, Table 1 shows the numbers with this property.



Table 1 showing
conversions to base 9

The base 10 numbers are 158, 227, 445, 1236, 1380, 2027, 2315, 2534, 5270, 5567, 5637, 5783, 10235, 10453, 11750, 13260, 13402, 13620, 21322, 21763, 21835, 23568, 26804, 32348, 34582, 35001, 35081, 35228, 37465 (permalink).

In base 11, the numbers and their conversions are shown in Table 2.


Table 2 showing
conversions to base 11

The numbers are 196, 283, 370, 1723, 4063, 7587, 8665, 15680, 16121, 18291, 19463, 19730, 23146, 26931, 32321, 35024, 38276 (permalink).

I won't show any further tables as they take up a fair amount of space but I'll list the results for other bases. Let's start with base 2 and work our way up (both only considering the range between 10 and 40000):
  • base 2: none
  • base 3: none
  • base 4: 13
  • base 5: none
  • base 6: 1045, 1135
  • base 7: 23, 46, 265, 316, 1030, 1234, 1366, 1431, 1454, 2060, 2116, 10144, 10342, 10542, 11425, 12415, 12450, 12564, 12651, 13045, 13245, 13534, 14610, 15226, 15643, 16255, 16546, 16633
  • base 8: 1273, 1653, 2154, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3226, 16273, 21753, 30576, 31457
  • base 9: 158, 227, 445, 1236, 1380, 2027, 2315, 2534, 5270, 5567, 5637, 5783, 10235, 10453, 11750, 13260, 13402, 13620, 21322, 21763, 21835, 23568, 26804, 32348, 34582, 35001, 35081, 35228, 37465
  • base 11:196, 283, 370, 1723, 4063, 7587, 8665, 15680, 16121, 18291, 19463, 19730, 23146, 26931, 32321, 35024, 38276
  • base 12: 2193, 6053, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7243, 7941, 9825, 24871, 25061, 25169, 34179
  • base 13: 43, 86, 191, 774, 958, 4621, 5272, 5812, 5920, 7364, 7834, 7873, 9304, 9343, 9413, 29103, 29610, 30189, 31112, 31481, 35731, 36417
  • base 14: 834, 6572, 9143, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739]
  • base 15: 261, 5180
  • base 16: 53, 371, 913, 4100, 5141, 5412, 6182, 8200, 9241
We'll stop at base 16 but we could go on of course. Let's put all those numbers above into one ordered list:

13, 23, 43, 46, 53, 86, 158, 191, 196, 227, 261, 265, 283, 316, 370, 371, 445, 774, 834, 913, 958, 1030, 1045, 1135, 1234, 1236, 1273, 1366, 1380, 1431, 1454, 1653, 1723, 2027, 2060, 2116, 2154, 2193, 2315, 2534, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3226, 4063, 4100, 4621, 5141, 5180, 5270, 5272, 5412, 5567, 5637, 5783, 5812, 5920, 6053, 6182, 6572, 7140, 7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149, 7243, 7364, 7587, 7834, 7873, 7941, 8200, 8665, 9143, 9241, 9304, 9343, 9413, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9825, 10144, 10235, 10342, 10453, 10542, 11425, 11750, 12415, 12450, 12564, 12651, 13045, 13245, 13260, 13402, 13534, 13620, 14610, 15226, 15643, 15680, 16121, 16255, 16273, 16546, 16633, 18291, 19463, 19730, 21322, 21753, 21763, 21835, 23146, 23568, 24871, 25061, 25169, 26804, 26931, 29103, 29610, 30189, 30576, 31112, 31457, 31481, 32321, 32348, 34179, 34582, 35001, 35024, 35081, 35228, 35731, 36417, 37465, 38276

There are no repeated numbers and there 158 numbers in total. Of these numbers, 31 are prime:

13, 23, 43, 53, 191, 227, 283, 1723, 2027, 3163, 3167, 4621, 5783, 6053, 7243, 7873, 9241, 9343, 9413, 9733, 9739, 10453, 15643, 16273, 16633, 19463, 25169, 31481, 32321, 35081, 35731

What stands out are the runs shown in blue above:
  • 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167 (base 8: permalink)
  • 7140, 7141, 7142, 7143, 7144, 7145, 7146, 7147, 7148, 7149 (base 12: permalink)
  • 9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739 (base 14: permalink)

Sunday, 20 July 2025

Hexadecimal Words

Certain hexadecimal numbers contain only letters between A (10) and F (16) and so can form English words. The commonly accepted words are:

a, aba, abaca, abed, accede, acceded, ace, aced, ad, add, added, baa, baad, babe, bad, bade, baff, baffed, be, bead, beaded, bed, bedded, bee, beef, beefed, cab, cad, cade, cafe, cede, ceded, cee, dab, dabbed, dace, dad, daff, dead, deaf, decade, dee, deed, deeded, deface, defaced, ebb, ebbed, efface, effaced, fa, facade, face, faced, fad, fade, faded, fed, fee, feed

These hexadecimal "words" with their decimal equivalents are shown below (arranged alphabetically):

10 --> a
2746 --> aba
703178 --> abaca
44013 --> abed
11325150 --> accede
181202413 --> acceded
2766 --> ace
44269 --> aced
173 --> ad
2781 --> add
712173 --> added
2986 --> baa
47789 --> baad
47806 --> babe
2989 --> bad
47838 --> bade
47871 --> baff
12255213 --> baffed
190 --> be
48813 --> bead
12496365 --> beaded
3053 --> bed
12508653 --> bedded
3054 --> bee
48879 --> beef
12513261 --> beefed
3243 --> cab
3245 --> cad
51934 --> cade
51966 --> cafe
52958 --> cede
847341 --> ceded
3310 --> cee
3499 --> dab
14334957 --> dabbed
56014 --> dace
3501 --> dad
56063 --> daff
57005 --> dead
57007 --> deaf
14600926 --> decade
3566 --> dee
57069 --> deed
14609901 --> deeded
14613198 --> deface
233811181 --> defaced
3771 --> ebb
965613 --> ebbed
15727310 --> efface
251636973 --> effaced
250 --> fa
16435934 --> facade
64206 --> face
1027309 --> faced
4013 --> fad
64222 --> fade
1027565 --> faded
4077 --> fed
4078 --> fee
65261 --> feed

The decimal numbers in ascending order are:

10, 173, 190, 250, 2746, 2766, 2781, 2986, 2989, 3053, 3054, 3243, 3245, 3310, 3499, 3501, 3566, 3771, 4013, 4077, 4078, 44013, 44269, 47789, 47806, 47838, 47871, 48813, 48879, 51934, 51966, 52958, 56014, 56063, 57005, 57007, 57069, 64206, 64222, 65261, 703178, 712173, 847341, 965613, 1027309, 1027565, 11325150, 12255213, 12496365, 12508653, 12513261, 14334957, 14600926, 14609901, 14613198, 15727310, 16435934, 181202413, 233811181, 251636973

OEIS A132676 shows these same numbers. 

If we are only interested in decimal numbers whose hexadecimal equivalents contain only letters and no digits from 0 to 9 then these are listed in OEIS A228774. Up to 40000, there are 258 of them and they can be generated via this permalink.

10, 11, 12, 13, 14, 15, 170, 171, 172, 173, 174, 175, 186, 187, 188, 189, 190, 191, 202, 203, 204, 205, 206, 207, 218, 219, 220, 221, 222, 223, 234, 235, 236, 237, 238, 239, 250, 251, 252, 253, 254, 255, 2730, 2731, 2732, 2733, 2734, 2735, 2746, 2747, 2748, 2749, 2750, 2751, 2762, 2763, 2764, 2765, 2766, 2767, 2778, 2779, 2780, 2781, 2782, 2783, 2794, 2795, 2796, 2797, 2798, 2799, 2810, 2811, 2812, 2813, 2814, 2815, 2986, 2987, 2988, 2989, 2990, 2991, 3002, 3003, 3004, 3005, 3006, 3007, 3018, 3019, 3020, 3021, 3022, 3023, 3034, 3035, 3036, 3037, 3038, 3039, 3050, 3051, 3052, 3053, 3054, 3055, 3066, 3067, 3068, 3069, 3070, 3071, 3242, 3243, 3244, 3245, 3246, 3247, 3258, 3259, 3260, 3261, 3262, 3263, 3274, 3275, 3276, 3277, 3278, 3279, 3290, 3291, 3292, 3293, 3294, 3295, 3306, 3307, 3308, 3309, 3310, 3311, 3322, 3323, 3324, 3325, 3326, 3327, 3498, 3499, 3500, 3501, 3502, 3503, 3514, 3515, 3516, 3517, 3518, 3519, 3530, 3531, 3532, 3533, 3534, 3535, 3546, 3547, 3548, 3549, 3550, 3551, 3562, 3563, 3564, 3565, 3566, 3567, 3578, 3579, 3580, 3581, 3582, 3583, 3754, 3755, 3756, 3757, 3758, 3759, 3770, 3771, 3772, 3773, 3774, 3775, 3786, 3787, 3788, 3789, 3790, 3791, 3802, 3803, 3804, 3805, 3806, 3807, 3818, 3819, 3820, 3821, 3822, 3823, 3834, 3835, 3836, 3837, 3838, 3839, 4010, 4011, 4012, 4013, 4014, 4015, 4026, 4027, 4028, 4029, 4030, 4031, 4042, 4043, 4044, 4045, 4046, 4047, 4058, 4059, 4060, 4061, 4062, 4063, 4074, 4075, 4076, 4077, 4078, 4079, 4090, 4091, 4092, 4093, 4094, 4095

The final number (4095) in the list above is equivalent to "f f f" in hexadecimal. All the English words listed at the start of this post will be included in this list of course. Up to one million, there are 8034 such decimal numbers with letter-only hexadecimal equivalents and there are significant gaps between groups of numbers. See Figure 1.


Figure 1: permalink
On vertical scale 1.0 = One Million

Thursday, 17 July 2025

Beyond Emirp

An emirp is a prime that remains prime when its digits are reversed. Palindromic primes are excluded as the reversed number must be different from the original. For example, 13 and 17 are both emirps because 31 and 71 are prime. Another way to phrase this is say that: 

An emirp is a number with one prime factor (itself) such that its reverse (a different number) also only has one factor. 

This definition allows for a generalisation and a special class of numbers arises, namely:

Numbers with \(k\) prime factors, counting multiplicity, such that their reversals are different numbers and also contain \(k\) prime factors, counting multiplicity.

It's easy to set up an algorithm to determine all such numbers in a given range for various values of \(k\). Let's consider the range up to 40000 and \(k=1\). This will generate the emirps. There are 980 of them in the given range so I won't list them here. The sequence members can be found at A006567 or by following this permalink. The first few are 13, 17, 31, 37, 71, 73, 79 and 97.

For \(k=2\), we get the semiprimes. There are an impressive 3450 in the range selected so again I won't show them here but the sequence members can be found at A097393 or by following this permalink. The first few are 15, 26, 39, 49, 51, 58, 62, 85, 93 and 94.

When \(k=3\), we get 2750 numbers that satisfy starting with 117. Here is a permalink that will generate the numbers. Let's use 117 as an example.$$ \begin{align} 117 &= 3 \times 3 \times 13\\711 &= 3 \times 3 \times 79 \end{align} $$When \(k=4\), we get 1302 numbers beginning with 126. Here is a permalink that will generate these numbers. Let's use 126 as an example.$$ \begin{align} 126 &= 2 \times 3 \times 3 \times 7 \\ 621 &= 3 \times 3 \times 3 \times 23 \end{align} $$ For \(k=5\), there are 429 numbers starting with 270. Here is a permalink that will generate the numbers. Let's look at 270.$$ \begin{align} 270 &= 2 \times 3 \times 3 \times 3 \times 5 \\ 72 &= 2 \times 2 \times 2 \times 3 \times 3  \end{align}$$For \(k=6\), there are 103 numbers in the range and so I'll list them. Here is a permalink that will generate the numbers. The first such number is 2576:$$ \begin{align} 2576 &= 2^4 \times 7 \times 23 \\6752 &= 2^5 \times 211 \end{align}$$2576, 2970, 4284, 4356, 4410, 4600, 4698, 4824, 5265, 5625, 6534, 6752, 6900, 8250, 8964, 10710, 10890, 13140, 13986, 16236, 16335, 17577, 18504, 19494, 20286, 20574, 21114, 21150, 21160, 21336, 21492, 21576, 21609, 21900, 21996, 22392, 22770, 22788, 22824, 22869, 23058, 23247, 23250, 23496, 23562, 23580, 23598, 24156, 24660, 24975, 25020, 25092, 25104, 25164, 25245, 25300, 25416, 25434, 25608, 25668, 26163, 26334, 26532, 27060, 27108, 27135, 27192, 27240, 27248, 27270, 27405, 27408, 27468, 27588, 27608, 27636, 27816, 28116, 28215, 28314, 28710, 28890, 29052, 29172, 29322, 29340, 29412, 29580, 29750, 29784, 29835, 29900, 29960, 29984, 32967, 34965, 35775, 35937, 36162, 36990, 37026, 38367, 38934

\(k=7\) generates 25 and this is a small enough number such that we can factorise them all. Here is the permalink to generate numbers.

  number   factor                 reverse   factor

  8820     2^2 * 3^2 * 5 * 7^2    288       2^5 * 3^2
  21240    2^3 * 3^2 * 5 * 59     4212      2^2 * 3^4 * 13
  21708    2^2 * 3^4 * 67         80712     2^3 * 3^2 * 19 * 59
  21780    2^2 * 3^2 * 5 * 11^2   8712      2^3 * 3^2 * 11^2
  21920    2^5 * 5 * 137          2912      2^5 * 7 * 13
  23280    2^4 * 3 * 5 * 97       8232      2^3 * 3 * 7^3
  23472    2^4 * 3^2 * 163        27432     2^3 * 3^3 * 127
  23625    3^3 * 5^3 * 7          52632     2^3 * 3^2 * 17 * 43
  23800    2^3 * 5^2 * 7 * 17     832       2^6 * 13
  25560    2^3 * 3^2 * 5 * 71     6552      2^3 * 3^2 * 7 * 13
  25584    2^4 * 3 * 13 * 41      48552     2^3 * 3 * 7 * 17^2
  25758    2 * 3^5 * 53           85752     2^3 * 3^3 * 397
  26280    2^3 * 3^2 * 5 * 73     8262      2 * 3^5 * 17
  27432    2^3 * 3^3 * 127        23472     2^4 * 3^2 * 163
  27504    2^4 * 3^2 * 191        40572     2^2 * 3^2 * 7^2 * 23
  27888    2^4 * 3 * 7 * 83       88872     2^3 * 3 * 7 * 23^2
  27900    2^2 * 3^2 * 5^2 * 31   972       2^2 * 3^5
  28836    2^2 * 3^4 * 89         63882     2 * 3^3 * 7 * 13^2
  29250    2 * 3^2 * 5^3 * 13     5292      2^2 * 3^3 * 7^2
  29403    3^5 * 11^2             30492     2^2 * 3^2 * 7 * 11^2
  29736    2^3 * 3^2 * 7 * 59     63792     2^4 * 3^2 * 443
  29970    2 * 3^4 * 5 * 37       7992      2^3 * 3^3 * 37
  30492    2^2 * 3^2 * 7 * 11^2   29403     3^5 * 11^2
  34884    2^2 * 3^3 * 17 * 19    48843     3^6 * 67
  36828    2^2 * 3^3 * 11 * 31    82863     3^5 * 11 * 31

For \(k=8\) there are only three such numbers (permalink):

  number   factor               reverse   factor

  16560    2^4 * 3^2 * 5 * 23   6561      3^8
  25515    3^6 * 5 * 7          51552     2^5 * 3^2 * 179
  27864    2^3 * 3^4 * 43       46872     2^3 * 3^3 * 7 * 31

For \(k =9\) there are four suitable numbers in the given range but for \(k>9\) there are no suitable numbers in the range.

  number   factor              reverse   factor

  21168    2^4 * 3^3 * 7^2     86112     2^5 * 3^2 * 13 * 23
  23424    2^7 * 3 * 61        42432     2^6 * 3 * 13 * 17
  23616    2^6 * 3^2 * 41      61632     2^6 * 3^2 * 107
  27456    2^6 * 3 * 11 * 13   65472     2^6 * 3 * 11 * 31

Tuesday, 15 July 2025

Palindromes Within Palindromes

I'm surprised that I've not covered this sequence before but checking through my previous posts it certainly seems as if I haven't. Here is the sequence in question:


A046351
  Palindromic composite numbers with only palindromic prime factors.

The initial members of this sequence, up to 40000, are (permalink):

4, 6, 8, 9, 22, 33, 44, 55, 66, 77, 88, 99, 121, 202, 242, 252, 262, 303, 343, 363, 393, 404, 484, 505, 525, 606, 616, 626, 686, 707, 808, 909, 939, 1111, 1331, 1441, 1661, 1991, 2112, 2222, 2662, 2772, 2882, 3333, 3443, 3773, 3883, 3993, 4224, 4444, 5445, 5555, 5775, 6336, 6666, 6776, 6886, 7777, 7997, 8448, 8888, 9999, 10201, 12221, 13231, 14641, 15251, 15851, 18281, 19291, 20402, 20602, 22622, 22822, 23232, 24442, 24842, 25152, 25452, 26462, 26662, 28682, 30603, 30903, 31613, 33933, 34643, 35653, 36663, 37673, 37873, 38683, 39693, 39993

There are 94 terms in all. Let's just look at the numbers with two distinct prime factors but each of which is two digits or longer. It can be noted that these numbers have either 11 or 101 as factors.

  number   factors

  1111     11 * 101
  1441     11 * 131
  1661     11 * 151
  1991     11 * 181
  3443     11 * 313
  3883     11 * 353
  7997     11 * 727
  13231    101 * 131
  15251    101 * 151
  18281    101 * 181
  19291    101 * 191
  31613    101 * 313
  35653    101 * 353
  37673    101 * 373
  38683    101 * 383

From the above it can be noted that multiplying a palindrome by 11 or 101 seems to produce another palindrome. By extension, multiplying a palindrome by 1001, 10001, 100001 etc. will often produce another palindrome. For example:$$10001\times 1340431 = 13405650431$$Even a series of alternating 1's and 0's may also produce palindromes. For example:$$10101 \times 1340431 = 13539693531$$However, such products of palindromes are NOT always palindromic. For example:$$ \begin{align} 11 \times 1949999491 &= 21449994401 \\ 101 \times 1949999491 &= 196949948591\\1001\times1940491 &= 1942431491\\10101 \times 1940491 &= 19600899591 \end{align}$$If all the digits of the second palindrome are less than 5 then the multiplication will always produce palindromes.

Saturday, 12 July 2025

13x+1 Record Breaker

Trajectory length record breakers for the 3\(x\) + 1, 5\(x\) + 1, 7\(x\) + 1, 11\(x\) + 1, 13\(x\) + 1 and 17\(x\) + 1 Collatz mappings are a fairly exclusive set of numbers and its members from 27859 to 40000 are 27859, 28927, 30301, 30771, 32326, 32581, 34239, 35556, 35655, 35803, 37647, 38030, 39053, 39254 and 39281. Why start at 27859? Well this is the number associated with my diurnal age and the next celebration of such an event is about three years away when I reach 28927 days old. 27859 is associated with the 13\(x\) + 1 mapping where the numbers that mark the record breaking trajectory lengths are shown in Figure 1.


Figure 1: see blog post

Figure 2 shows the trajectory for 27859 using a logarithmic scale for the vertical axis.


Figure 2: permalink

The trajectory is as follows ending in a 7, 1, 14, 7 loop. The maximum value reached is an impressive \( \textbf{1,004,280,846,804} \). That's just over a trillion. That's why a logarithmic scale was needed for the vertical axis!

27859, 362168, 181084, 90542, 45271, 588524, 294262, 147131, 1912704, 956352, 478176, 239088, 119544, 59772, 29886, 14943, 4981, 64754, 32377, 420902, 210451, 2735864, 1367932, 683966, 341983, 4445780, 2222890, 1111445, 222289, 2889758, 1444879, 18783428, 9391714, 4695857, 61046142, 30523071, 10174357, 132266642, 66133321, 859733174, 429866587, 5588265632, 2794132816, 1397066408, 698533204, 349266602, 174633301, 2270232914, 1135116457, 14756513942, 7378256971, 95917340624, 47958670312, 23979335156, 11989667578, 5994833789, 856404827, 11133262752, 5566631376, 2783315688, 1391657844, 695828922, 347914461, 115971487, 1507629332, 753814666, 376907333, 34264303, 445435940, 222717970, 111358985, 22271797, 289533362, 144766681, 1881966854, 940983427, 12232784552, 6116392276, 3058196138, 1529098069, 19878274898, 9939137449, 129208786838, 64604393419, 839857114448, 419928557224, 209964278612, 104982139306, 52491069653, 4771915423, 433810493, 5639536410, 2819768205, 939922735, 187984547, 2443799112, 1221899556, 610949778, 305474889, 101824963, 1323724520, 661862260, 330931130, 165465565, 33093113, 430210470, 215105235, 71701745, 14340349, 186424538, 93212269, 1211759498, 605879749, 7876436738, 3938218369, 51196838798, 25598419399, 3656917057, 47539921742, 23769960871, 309009491324, 154504745662, 77252372831, 1004280846804, 502140423402, 251070211701, 83690070567, 27896690189, 362656972458, 181328486229, 60442828743, 20147609581, 1831600871, 23810811324, 11905405662, 5952702831, 1984234277, 25795045602, 12897522801, 4299174267, 1433058089, 18629755158, 9314877579, 3104959193, 443565599, 5766352788, 2883176394, 1441588197, 480529399, 68647057, 892411742, 446205871, 5800676324, 2900338162, 1450169081, 18852198054, 9426099027, 3142033009, 40846429118, 20423214559, 1856655869, 24136526298, 12068263149, 4022754383, 52295806980, 26147903490, 13073951745, 4357983915, 1452661305, 484220435, 96844087, 1258973132, 629486566, 314743283, 4091662680, 2045831340, 1022915670, 511457835, 170485945, 34097189, 4871027, 695861, 9046194, 4523097, 1507699, 19600088, 9800044, 4900022, 2450011, 31850144, 15925072, 7962536, 3981268, 1990634, 995317, 12939122, 6469561, 924223, 12014900, 6007450, 3003725, 600745, 120149, 1561938, 780969, 260323, 37189, 483458, 241729, 3142478, 1571239, 20426108, 10213054, 5106527, 66384852, 33192426, 16596213, 5532071, 71916924, 35958462, 17979231, 5993077, 77910002, 38955001, 506415014, 253207507, 36172501, 470242514, 235121257, 33588751, 4798393, 62379110, 31189555, 6237911, 81092844, 40546422, 20273211, 6757737, 2252579, 321797, 45971, 597624, 298812, 149406, 74703, 24901, 323714, 161857, 2104142, 1052071, 13676924, 6838462, 3419231, 44450004, 22225002, 11112501, 3704167, 48154172, 24077086, 12038543, 1094413, 14227370, 7113685, 1422737, 18495582, 9247791, 3082597, 440371, 5724824, 2862412, 1431206, 715603, 102229, 1328978, 664489, 94927, 13561, 176294, 88147, 1145912, 572956, 286478, 143239, 1862108, 931054, 465527, 6051852, 3025926, 1512963, 504321, 168107, 2185392, 1092696, 546348, 273174, 136587, 45529, 4139, 53808, 26904, 13452, 6726, 3363, 1121, 14574, 7287, 2429, 347, 4512, 2256, 1128, 564, 282, 141, 47, 612, 306, 153, 51, 17, 222, 111, 37, 482, 241, 3134, 1567, 20372, 10186, 5093, 463, 6020, 3010, 1505, 301, 43, 560, 280, 140, 70, 35, 7, 1, 14, 7

Friday, 11 July 2025

A Special Number: 3367

 Figure 1 shows an interesting result via Cliff Pickover.


To see why 3367 can be written as the various fractions shown, one approach is to consider a number of the form \( 0 \, a \, 0 \, a \, 0 \, a\) where \(1 \geq a \geq 99\). Let's manipulate this number in the following way:$$  \begin{align} \frac{0 \, a \, 0 \, a \, 0 \, a}{a+a+a} &= \frac{a \times 0 \, 1 \, 0 \, 1 \, 0 \, 1}{3 \, a}\\ \\ &= \frac{0 \, 1 \, 0 \, 1 \, 0 \, 1}{3} \\  \\ &=3 \, 3 \, 6 \,7 \end{align}$$Thus when \(a=11\) we have:$$\frac{0 \, a \, 0 \, a \, 0 \, a}{a+a+a} = \frac{1 \, 1 \, 1 \, 1 \, 1 \, 1}{11 + 11 +11}$$If \(a>99\), then the pattern breaks down.

Thursday, 10 July 2025

A Peculiarity

Sometimes, when looking for properties of the number associated with my diurnal age, I struggle to find a property that interests me. Today was one such occasion and the number was 27857. However, I did notice a "peculiarity" as I call it and it involved both the sum of the number's digits cubed and the number's proper divisors. Firstly, the digits cubed:$$ \begin{align} 27857 &\rightarrow 2^3+7^3+8^3+5^3+7^3\\ &=1331 \end{align}$$Next, let's consider the number's proper divisors:$$ \begin{align} 27857 &\rightarrow 1, 89, 313 \text{ as proper divisors} \\ \text{sum of proper divisors }&=403 \\ &=13 \times 31 \\ &\rightarrow 1331 \text{ when concatenated} \end{align} $$

This peculiarity is quite rare and in fact up to \( \textbf{one hundred million} \), there is only one other number with this same property and that is 150809. The details are:$$ \begin{align} 150809 &\rightarrow 1^3+5^3+0^3+8^3+0^3+9^3\\ &=1367\\ \\150809 &\rightarrow 1, 239, 631 \text{ as proper divisors} \\ \text{sum of proper divisors }&=871 \\ &=13\times 67 \\ &\rightarrow 1367 \text{ when concatenated} \end{align} $$So 27857 has a very interesting property after all, even if it is rather obscure. I still find it rather amazing that I was able to check up to one hundred million using SageMath on my M1 Macbook Air.

Wednesday, 9 July 2025

Partitions and Generating Functions

I asked Gemini to explain the statement:

“It’s long been known that you can associate
a polynomial equation to any partition.”

Here's what it came up with.

The statement refers to the relationship between an integer partition and a generating function, which is a way of encoding an infinite sequence of numbers as the coefficients of a formal power series. In this context, the "polynomial equation" is more accurately a generating function, which can be represented as a polynomial-like expression.


A partition of a positive integer \(n\) is a way of writing \(n\) as a sum of positive integers. The order of the addends (the parts of the partition) does not matter. For example, the partitions of the number 4 are:

  • 4

  • 3 + 1

  • 2 + 2

  • 2 + 1 + 1

  • 1 + 1 + 1 + 1

The statement means that for any given integer, we can construct a polynomial-like expression (a generating function) that "encodes" all of its possible partitions.

How the Association Works

The connection is established through the concept of generating functions. The generating function for the number of partitions of an integer \(n\), denoted as \( p(n) \), can be expressed as an infinite product:$$P(x) = \sum_{n=0}^{\infty} p(n)x^n = \prod_{k=1}^{\infty} \frac{1}{1-x^k}$$Let's break down this formula:

  • \( p(n) \) This represents the number of partitions for an integer \(n\)

  • \( \displaystyle\sum_{n=0}^{\infty} p(n)x^n \) This is the power series where the coefficient of \(x^n\) is the number of partitions of \(n\).

  • \(\displaystyle\prod_{k=1}^{\infty} \dfrac{1}{1-x^k}\) This is the infinite product that generates these coefficients.


Each term in the product \( \dfrac{1}{1-x^k} \) can be expanded as a geometric series:

  • \(\dfrac{1}{1-x} = 1 + x + x^2 + x^3 + \dots \) This represents using the number 1 as a part in the partition

  • \(\dfrac{1}{1-x^2} = 1 + x^2 + x^4 + x^6 + \dots\) This represents using the number 2 as a part

  • \( \dfrac{1}{1-x^3} = 1 + x^3 + x^6 + x^9 + \dots \) This represents using the number 3 as a part

  • And so on for all integers \(k\).

When you multiply these series together, the coefficient of \(x^n\) in the resulting series will be the total number of ways to form \(n\) by adding these parts.

Examples

Let's find the partitions for the number 3. The partitions are:

  • 3

  • 2 + 1

  • 1 + 1 + 1

There are 3 partitions of 3.


Now, let's see how the generating function gives us this result. We look at the expansion of the product:$$(1 + x + x^2 + x^3 + \dots)(1 + x^2 + x^4 + \dots)(1 + x^3 + x^6 + \dots) \dots$$To get the term \(x^3\), we can combine terms from these expansions in the following ways:

  • From the first factor, take \(x^3\). This corresponds to the partition 1 + 1 + 1.

  • From the first factor, take \(x^1\), and from the second factor, take \(x^2\). This corresponds to the partition 1 + 2.

  • From the third factor, take \(x^3\). This corresponds to the partition 3.


The coefficient of \(x^3\) is therefore 3, which matches the number of partitions.


Here is another example for the partitions of 4, which we know is 5.


To find the coefficient of \(x^4\), we would consider combinations like:

  • \(x^4\) from the first factor: 1 + 1 + 1 + 1

  • \(x^2\) from the first factor and \(x^2\) from the second: 1 + 1 + 2

  • \(x^1\) from the first factor and \(x^3\) from the third: 1 + 3

  • \(x^4\) from the second factor: 2 + 2

  • \(x^4\) from the fourth factor: 4


The total number of ways to get \(x^4\) is 5, so the coefficient is 5.


In essence, the "polynomial" or generating function provides a systematic way to count the number of partitions for any integer by looking at the coefficients of the series expansion.