Showing posts with label reverse and add. Show all posts
Showing posts with label reverse and add. Show all posts

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, ... this is OEIS A109026.

\(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, 20 May 2025

Revisiting Reverse and Add

Numbers \(n\) belonging to OEIS A063048 have the property that the Reverse and Add! trajectory of \(n\) (presumably) does not reach a palindrome and does not join the trajectory of any term \(m < n\). Up to 40,000 these numbers are:

196, 879, 1997, 7059, 10553, 10563, 10577, 10583, 10585, 10638, 10663, 10668, 10697, 10715, 10728, 10735, 10746, 10748, 10783, 10785, 10787, 10788, 10877, 10883, 10963, 10965, 10969, 10977, 10983, 10985, 12797, 12898, 13097, 13197, 13694, 14096, 14698, 15297, 15597, 18598, 18798, 19098, 20459, 30389, 30399, 30929, 30959, 30979

Now there are many more numbers that presumably do not reach a palindrome but they join the trajectories of the above numbers at some point and thus do not fulfil the \(m<n\) condition. These numbers belong to OEIS A023108: positive integers which apparently never result in a palindrome under repeated applications of the function A056964(\(x\)) = \(x\) + (\(x\) with digits reversed). 

\( \textbf{27806} \), my diurnal age today, is one such number. I tested it for 30,000 iterations and still no palindrome was found. Now 39996 is the 1750th member of the sequence and so these numbers represent 4.375% of the total numbers in the range. Some numbers coming up soon are 27812,  27837,  27847,  27866,  27896,  27906,  27912,  27914,  27956,  27964 and 27988. Between 27806 and 40,000 these numbers (which include all those in OEIS A063048) are:

27806,  27812,  27837,  27847,  27866,  27896,  27906,  27912,  27914,  27956,  27964,  27988,  28036,  28046,  28055,  28056,  28095,  28096,  28146,  28156,  28193,  28236,  28256,  28266,  28281,  28286,  28332,  28341,  28342,  28346,  28356,  28362,  28369,  28469,  28487,  28496,  28502,  28504,  28545,  28546,  28566,  28576,  28586,  28595,  28596,  28597,  28616,  28643,  28657,  28686,  28696,  28702,  28704,  28706,  28707,  28732,  28736,  28776,  28796,  28797,  28802,  28827,  28837,  28856,  28886,  28896,  28902,  28904,  28946,  28954,  28978,  29026,  29036,  29045,  29046,  29085,  29086,  29097,  29136,  29146,  29183,  29226,  29246,  29256,  29271,  29276,  29322,  29331,  29332,  29336,  29346,  29352,  29359,  29396,  29459,  29477,  29486,  29494,  29499,  29535,  29536,  29556,  29566,  29576,  29585,  29586,  29587,  29590,  29606,  29633,  29647,  29676,  29686,  29722,  29726,  29766,  29786,  29787,  29791,  29796,  29817,  29827,  29846,  29876,  29886,  29899,  29936,  29944,  29968,  29997,  30089,  30358,  30389,  30399,  30439,  30458,  30479,  30489,  30536,  30551,  30561,  30575,  30581,  30583,  30636,  30651,  30661,  30666,  30695,  30713,  30726,  30733,  30744,  30746,  30781,  30783,  30785,  30786,  30841,  30849,  30875,  30881,  30889,  30929,  30931,  30959,  30961,  30963,  30967,  30975,  30979,  30981,  30983,  31079,  31348,  31379,  31389,  31429,  31448,  31469,  31479,  31526,  31541,  31551,  31565,  31571,  31573,  31626,  31641,  31651,  31656,  31685,  31703,  31716,  31723,  31734,  31736,  31771,  31773,  31775,  31776,  31831,  31839,  31865,  31871,  31879,  31896,  31919,  31921,  31949,  31951,  31953,  31957,  31965,  31969,  31971,  31973,  32069,  32095,  32295,  32338,  32369,  32379,  32391,  32419,  32438,  32459,  32469,  32516,  32531,  32541,  32555,  32561,  32563,  32616,  32631,  32641,  32646,  32675,  32706,  32713,  32724,  32726,  32761,  32763,  32765,  32766,  32791,  32795,  32821,  32829,  32855,  32861,  32869,  32886,  32896,  32909,  32911,  32939,  32941,  32943,  32947,  32955,  32959,  32961,  32963,  32999,  33059,  33085,  33095,  33195,  33285,  33328,  33359,  33369,  33381,  33390,  33391,  33395,  33409,  33428,  33449,  33459,  33499,  33506,  33521,  33531,  33545,  33551,  33553,  33594,  33595,  33606,  33621,  33631,  33636,  33665,  33692,  33703,  33714,  33716,  33751,  33753,  33755,  33756,  33781,  33785,  33811,  33819,  33845,  33851,  33859,  33876,  33886,  33901,  33929,  33931,  33937,  33945,  33949,  33951,  33953,  33989,  33995,  34049,  34075,  34085,  34094,  34095,  34185,  34195,  34275,  34295,  34318,  34349,  34359,  34371,  34380,  34381,  34385,  34395,  34418,  34439,  34449,  34489,  34511,  34521,  34535,  34541,  34584,  34585,  34611,  34621,  34626,  34655,  34682,  34696,  34704,  34706,  34741,  34745,  34746,  34771,  34775,  34801,  34809,  34835,  34841,  34849,  34866,  34876,  34895,  34899,  34919,  34921,  34923,  34927,  34935,  34939,  34941,  34979,  34985,  34993,  35039,  35065,  35075,  35084,  35085,  35175,  35185,  35265,  35285,  35295,  35308,  35339,  35349,  35361,  35370,  35371,  35375,  35385,  35391,  35398,  35408,  35429,  35439,  35479,  35498,  35501,  35511,  35525,  35531,  35533,  35574,  35575,  35595,  35601,  35611,  35616,  35645,  35672,  35686,  35731,  35733,  35735,  35736,  35761,  35765,  35825,  35831,  35839,  35856,  35866,  35885,  35889,  35909,  35911,  35913,  35917,  35925,  35929,  35931,  35933,  35969,  35975,  35983,  35999,  36029,  36055,  36065,  36074,  36075,  36165,  36175,  36255,  36275,  36285,  36329,  36339,  36351,  36360,  36361,  36365,  36375,  36381,  36388,  36419,  36429,  36469,  36488,  36501,  36515,  36521,  36523,  36564,  36565,  36585,  36595,  36601,  36606,  36635,  36662,  36676,  36721,  36723,  36725,  36726,  36751,  36755,  36795,  36815,  36821,  36829,  36846,  36856,  36875,  36879,  36901,  36903,  36907,  36915,  36919,  36921,  36923,  36959,  36965,  36973,  36989,  36997,  37019,  37045,  37055,  37064,  37065,  37155,  37165,  37245,  37265,  37275,  37290,  37295,  37319,  37329,  37341,  37350,  37351,  37355,  37365,  37371,  37378,  37409,  37419,  37459,  37478,  37496,  37499,  37505,  37511,  37513,  37554,  37555,  37575,  37585,  37595,  37625,  37652,  37666,  37695,  37711,  37713,  37715,  37716,  37741,  37745,  37785,  37805,  37811,  37819,  37836,  37846,  37865,  37869,  37895,  37905,  37909,  37911,  37913,  37949,  37955,  37963,  37979,  37987,  37999,  38009,  38035,  38045,  38054,  38055,  38094,  38095,  38099,  38145,  38155,  38192,  38235,  38255,  38265,  38280,  38285,  38309,  38319,  38331,  38340,  38341,  38345,  38355,  38361,  38368,  38399,  38409,  38449,  38468,  38486,  38489,  38495,  38499,  38501,  38503,  38544,  38545,  38565,  38575,  38585,  38594,  38595,  38596,  38615,  38642,  38656,  38685,  38695,  38701,  38703,  38705,  38706,  38731,  38735,  38775,  38795,  38796,  38801,  38809,  38826,  38836,  38855,  38859,  38885,  38895,  38899,  38901,  38903,  38939,  38945,  38953,  38969,  38977,  38989,  39025,  39035,  39044,  39045,  39084,  39085,  39089,  39096,  39135,  39145,  39182,  39225,  39245,  39255,  39270,  39275,  39309,  39321,  39330,  39331,  39335,  39345,  39351,  39358,  39389,  39395,  39439,  39458,  39476,  39479,  39485,  39489,  39498,  39534,  39535,  39555,  39565,  39575,  39584,  39585,  39586,  39605,  39632,  39646,  39675,  39685,  39721,  39725,  39765,  39785,  39786,  39790,  39791,  39795,  39816,  39826,  39845,  39849,  39875,  39885,  39889,  39891,  39898,  39929,  39935,  39943,  39959,  39967,  39979,  39996

Thursday, 20 February 2025

An Interesting Triple 7 Number

Today I turned \( \textbf{27717} \) days old and this number has a plethora of interesting properties that deserve a special mention and thus a dedicated post. Here are some of those properties.

  • \( \textbf{27717} \) is a so-called Lucky Cube, meaning it is a number whose cubes contain the digit sequence “888”, here:$$27717^3 = 21293088810813$$The numbers that satisfy from 27717 to 40000 are: 27717, 27942, 27973, 28192, 28442, 28484, 28692, 28740, 28942, 29079, 29192, 29354, 29387, 29391, 29418, 29420, 29442, 29491, 29642, 29692, 29942, 29989.

  • \( \textbf{27717} \) is the lesser of a pair of adjacent composite numbers such that both are only one step away from their home primes. Here: 
    • \(27717 = 3 \times 9239 \rightarrow 39239\)
    • \(27718 = 2 \times 13859 \rightarrow 213859\)

  • \( \textbf{27717} \) is a number such that n + POD(n) and n - POD(n) are both prime (where POD stands for Product Of Digits). Here we have POD = 686:
    • \(27717 + 686 = 28403\) which is a prime number
    • \(27717 - 686 = 27031\) which is a prime number

  • \( \textbf{27717} \) is an interprime number because it is at equal distance from the previous prime (27701) and the next prime (27733).

  • \( \textbf{27717} \) is a number whose sum of divisors has prime factors (ignoring multiplicity) that multiply to the factorial 2310 where

    \(2310= 2 \times 3 \times 5 \times 7 \times 11\)

    Here 27717 has a sum of divisors 36960 and

    \(36960= 2^5 \times 3 \times 5 \times 7 \times 11\)

    but also forms a consecutive pair with 27718 because its sum of the divisors is 41580 and

    \(41580= 2^2 \times 3^3 \times 5  \times 7 \times11\)

    See blog post Primorials and the Sigma Function.

  • \( \textbf{27717} \) is the TENTH member of an interesting number chain (which is base independent):
    • \(27708 = 12 \times 2309\)
    • \(27709 = 11 \times 2519\)
    • \(27710 = 10 \times 2771\)
    • \(27711 = 9 \times 3079\)
    • \(27712 = 8 \times 3464\)
    • \(27713 = 7 \times 3959\)
    • \(27714 = 6 \times 4619\)
    • \(27715 = 5 \times 5543\)
    • \(27716 = 4 \times 6929\)
    • \(27717 = 3 \times 9239\)
    • \(27718 = 2 \times 13859\)
See blog post Count Down Number Chains  
 
  • \( \textbf{27717} \) is a cyclic number.

  • \( \textbf{27717} \) is a xenodrome in base 9 : 42016. See blog post Xenodromes.

  • \( \textbf{27717} \) is a number that does not reach a palindrome after 2001 cycles of the reverse and add algorithm.

  • \( \textbf{27717} \) is a D-number meaning it is a number \(n > 3\) such that n divides \( k^{n-2}- k\) for all \(1 < k < n\) relatively prime to \(n\).

  • \( \textbf{27717} \) can be rendered as a digit equation as follows: \(2 - \dfrac{7}{7} = 1 ^ 7\)

Tuesday, 12 March 2024

27372: Another Palindromic Day

Days like today, when I turn 27372 days old, pop up every one hundred days during the course of a millennium of days and there is a 110 day gap between millennia. So, for example, from 27972 to 28082, there will be a gap of 110 days. Today's number shares some important properties with another palindrome, 26362, that I created a post about on June 6th 2021. It was titled 26362: Another Special Palindrome

One property that the two share is that they are both members of OEIS  A070001:


 A070001

Palindromic integers > 0, whose 'Reverse and Add!' trajectory (presumably) does not lead to another palindrome.


Up to 40000, the members of this sequence are not numerous and they are:

4994, 8778, 9999, 11811, 19591, 22822, 23532, 23632, 23932, 24542, 24742, 24842, 24942, 26362, 27372, 29792, 29892, 33933, 34543, 34743, 34943, 39493

It can be seen that 26362 and 27372 are consecutive and 1010 days apart in terms of my diurnal age. As I wrote in the post previously alluded to:

These palindromes are not regarded as potential Lychrel numbers because they are already palindromes and some of them are the result or end point of \(k\) + reverse(\(k\)) iterations. However, some are not and these, I think, deserve special consideration. These are:

19591, 23532, 23932, 24542, 24742, 24942, 26362, 27372, 29792, 33933, 34543, 34743, 34943, 39493

So 26362 and 27372 are paired again and they are only the 7th and 8th palindromes to have the simultaneous property that:

  • they cannot be derived from \(k\) + reverse(\(k\)) for one or more values of \(k\)
  • their Reverse and Add trajectories (presumably) do not lead to another palindrome 
These two numbers are also members of OEIS A045960:


 A045960

Palindromic even lucky numbers.



Up to 40000, the initial members are:

2, 4, 6, 22, 44, 212, 262, 282, 434, 474, 646, 666, 818, 838, 868, 2442, 2662, 2772, 4884, 4994, 6666, 6886, 8118, 8338, 20202, 20402, 21012, 21812, 22322, 22422, 22922, 23332, 23532, 24042, 25652, 26162, 26262, 26562, 26762, 27372, 28682

A property that 27372 doesn't share with 26762 is that the former's arithmetic digital root is the same of its middle digit. Of the three and five digit palindromes in the range up to 40000, there are only 36 that satisfy this condition. They are (permalink):

919, 929, 939, 949, 959, 969, 979, 989, 999, 18181, 18281, 18381, 18481, 18581, 18681, 18781, 18881, 18981, 27172, 27272, 27372, 27472, 27572, 27672, 27772, 27872, 27972, 36163, 36263, 36363, 36463, 36563, 36663, 36763, 36863, 36963

For example, the arithmetic digital root of 27372 is 2 + 7 + 3 + 7 + 2 = 21 and 2 + 1 = 3. The middle digit of 27372 is 3.

Friday, 24 February 2023

26990: Reverse and Add

I first posted on the topic of Reverse and Add on the 7th January 2016, less than six months after I started this blog. The post was titled 22, Reverse and Add, and later that year (22nd June 2016)  I made a post titled Remembering Reverse and Add, Palindromes and Trajectories. The post titled Lychrel Numbers on 14th September 2016 is also relevant. Since 2016 I've touched on the topic in several other posts.

Today I turned 26990 days old and one of the properties of this number is that it's a member of OEIS A065318:


 A065318

24 'Reverse and Add' steps are needed to reach a palindrome.



Such a large number of steps is uncommon as can be seen from the membership:

89, 98, 16991, 17981, 18971, 19961, 26990, 27980, 28970, 29960, 50169, 51159, 52149, 53139, 54129, 55119, 56109, 56199, 57189, 58179, 59169, 60168, 60649, 61158, 61639, 62148, 62629, 63138, 63619, 64128, 64609, 64699, 65118, 65689, 66108, 66198, 66679, 67188, 67669, 68178, 68659, 69168, 69649, 70167, 70648, 71157, 71638, 72147, 72628, 73618, 74127, 74608, 74698, 75117, 75688, 76107, 76197, 76678, 77187, 77668, 78177, 78658, 79167, 79648, 80166, 80339, 80499

To get an overview of what's going on, I plotted the length of the trajectories of all numbers from 1 to 40000. The result is shown in Figure 1 where the initial members of the sequence (89, 98, 16991, 17981, 18971, 19961, 26990, 27980, 28970, 29960) are clearly visible along the red line.


Figure 1: permalink

The calculation timed out in SageMathCell and so the plot was created using my Jupyter notebook which has proven invaluable for computationally intense tasks. Sometimes the kernel will crash and the tasks cannot be completed but this is not all that common. The plot also shows how rare trajectory lengths of 24 and above are. Figure 2 shows a similar plot both this time in the range up to 100,000. As can be seen, the numbers that have trajectory lengths of 24, while initially scarce, become more frequent between 50,000 and 100,000. Some other trajectory red lines have also been marked in addition to that of 24.


Figure 2

Figure 3 shows the trajectories for numbers up to one million. Notice how the trajectory 24 numbers are fairly numerous between 50,000 and 500,000 but after that there is a gap followed by three equally spaced groups and then no numbers after about 800,000. Again, this plot was only achieved using a Jupyter notebook and letting my old 2013 laptop crunch away at the calculation.


Figure 3

As the range gets larger, new trajectory lengths begin to appear. For example, a group of numbers in equally spaced clumps appear with trajectory length 64 between about 180,000 and 820,000.

Sunday, 6 June 2021

26362: Another Special Palindrome

The day that I turned 26262 days old I dedicated a post to the number and titled it 26262: A Special Palindrome. That was on February 21st 2021. Today I'm enjoying the next successive palindromic day, having turned 26362 days old. 

Now this is a somewhat unusual palindrome in that it is not a member of OEIS A067030


A067030



Numbers \(n\) that are of the form \(k\) + reverse(\(k\)) for at least one \(k\).



Let's be clear firstly that such numbers are not common. The 1000th such number is 38772 which translates to a percentage density of less than 2.6%. The first such numbers are:
0, 2, 4, 6, 8, 10, 11, 12, 14, 16, 18, 22, 33, 44, 55, 66, 77, 88, 99, 101, 110, 121, 132, 141, 143, 154, 161, 165, 176, 181, 187, 198, 201, 202, 221, 222, 241, 242, 261, 262, 281, 282, 302, 303, 322, 323, 342, 343, 362, 363, 382, 383, 403, 404, 423, 424, 443 
Of these first 56 members of the sequence, 29 (more than 50%) are palindromic. This is not surprising because most numbers, under the repeated Reverse and Add operation, lead to a palindrome. 196 is the first number that apparently does not. Let's look at the palindromes not belonging to this sequence: 

131, 151, 171, 191, 212, 232, 252, 272, 292, 313, 333, 353, 373, 393, 434

All of them lead to palindromes under Reverse and Add, as shown below:

131 requires 1 steps to reach the palindrome 262
151 requires 2 steps to reach the palindrome 505
171 requires 2 steps to reach the palindrome 585
191 requires 4 steps to reach the palindrome 2552
212 requires 1 steps to reach the palindrome 424
232 requires 1 steps to reach the palindrome 464
252 requires 2 steps to reach the palindrome 909
272 requires 2 steps to reach the palindrome 989
292 requires 8 steps to reach the palindrome 233332
313 requires 1 steps to reach the palindrome 626
333 requires 1 steps to reach the palindrome 666
353 requires 3 steps to reach the palindrome 4444
373 requires 4 steps to reach the palindrome 9559
393 requires 4 steps to reach the palindrome 9339
434 requires 1 steps to reach the palindrome 868

26362 as it turns out is a member of OEIS A070001:


 A070001

Palindromes whose 'Reverse and Add' trajectory (presumably) does not lead to another palindrome.

 The initial members of this sequence are:

4994, 8778, 9999, 11811, 19591, 22822, 23532, 23632, 23932, 24542, 24742, 24842, 24942, 26362, 27372, 29792, 29892, 33933, 34543, 34743, 34943, 39493, 44744, 46064, 46164, 46364, 46564, 46964, 47274, 47574, 48284, 48584, 48684, 48884

These palindromes are not regarded as potential Lychrel numbers because they are already palindromes and some of them are the result or end point of \(k\) + reverse(\(k)\) iterations. However, some are not and these, I think, deserve special consideration:

19591, 23532, 23932, 24542, 24742, 24942, 26362, 27372, 29792, 33933, 34543, 34743, 34943, 39493, 44744, 46164, 46364, 46564, 46964, 47574, 48584

So 26362 is only the 7th palindrome to have the simultaneous property that:

  • it cannot be derived from \(k\) + reverse(\(k\)) for one or more values of \(k\)
  • its Reverse and Add trajectory (presumably) does not lead to another palindrome
There already two sevens associated with the number because \(7^2\) is a factor, so we have a lucky triple 7.


This is not the first time that I've written about palindromic numbers. Apart from my 26262: A Special Palindrome post, I've written about:
In researching this post, I came across a category of primes known as Palindromic Wing Primes or PMPs defined as "numbers that are primes, palindromic in base 10, and consisting of one central digit surrounded by two wings having an equal amount of identical digits and different from the central one". Examples are:

101
99999199999
333333313333333
7777777777772777777777777
11111111111111111111111111111111411111111111111111111111111111111

Some of these primes are regarded as potential Lychrel candidates and are listed in OEIS A320516 (with the rule that palindromes are ineligible being relaxed):


 A320516

Palindromic wing primes that are also Lychrel candidates.        
    

Initial members are:
7774777, 777767777, 77777677777, 99999199999, 1111118111111, 7777774777777, 111111181111111, 333333373333333, 77777777677777777, 99999999299999999, 9999999992999999999, 33333333333733333333333, 77777777777677777777777, 333333333333373333333333333

More information about PWPs can be found here. Palindromes and any numbers can be tested for Lychrel candidature using SageMathCell. A permalink is attached to the screenshoot in Figure 1.

Figure 1: permalink 

Thursday, 15 March 2018

The Collatz Conjecture Revisited

Some time ago I posted about the Collatz Conjecture. Today's and yesterday's numbers (25183 and 25182 respectively) are connected to this conjecture. In general, these numbers arise because I'm tracking the number of days that I've been alive, numbering the day I was born (April 3rd 1949) as day zero and counting forward from there.

Both numbers appear in the Online Encyclopaedia of Integer Sequences (OEIS) A224303, whose members comprise numbers n for which number of iterations to reach the largest equals number of iterations to reach 1 from the largest in Collatz (3x+1) trajectory of n.

It's easy enough to set up a spreadsheet that calculates the number of steps to reach 1 and also the number of steps to reach the largest number in the trajectory. This is what I've done in Google Sheets and I've included a screenshot below for 25183.


As can be seen, 116 steps are required to get to the largest number (6,810,136) in the trajectory and then the same number of steps to reach 1, making for 232 steps in all. The steps for the previous number 25182 are the same. Here is a graph of the trajectory:


Looking at the sequence of such numbers, it's apparent that they tend to cluster and often appear in groups of two or more. Here is the list as it is shown in OEIS A224303 (with clusters shown in different colours):

1, 6, 120, 334, 335, 804, 1249, 2008, 2010, 2012, 2013, 6556, 6557, 6558, 6801, 6802, 6803, 7496, 7498, 7500, 7501, 7505, 10219, 22633, 25182, 25183, 27074, 27075, 27864, 27866, 27868, 31838, 31839, 32078, 36630, 36633, 36690, 36691, 36914, 39126, 39344

The second member of the sequence, 6, is given as an example: 6 is in the list because the Collatz trajectory of 6 is {6, 3, 10, 5, 16, 8, 4, 2, 1} and four steps are required to reach the largest number number (16) and four steps are required to reach 1 from 16:

6 --> 3 --> 10 --> 5 --> 16 and then 16 --> 8 --> 4 ---> 2 --> 1

Of course, there's a site on the Internet that will calculate the number of steps and graph the result. It also contains other interesting information relating to the Collatz conjecture. My spreadsheet will graph the trajectory but one has to manually alter the upper bound to get the best looking graph. I haven't figured out a way to adjust it automatically but I'll keep working on it.

Remember that the rule is to divide by 2 if the number is even and multiply by 3 and add 1 if the number is odd (hence the "3x+1 problem" as an alternative moniker). However, the site mentioned also allows one to customise the algorithm, so that for example instead of multiplying by 3, one can multiply by 2.


Interestingly, the trajectory still reaches 1 but it takes 669 steps and it's graph is quite different to that followed using the standard algorithm. Using larger multipliers like 4 doesn't seem to lead to convergence. For example after 10000 iterations using 4 as the multiplier, one gets 6,922,158,704,601,770. I'm not sure what happens with more iterations. The site also has a page for testing Lychrel numbers. I've looked at these sorts of numbers before but hadn't realised that they were called Lychrel numbers. I'd been referring to the algorithm to find them, namely reverse and add. See this post and this post to view.

See also: https://voodooguru23.blogspot.com/2018/03/the-px1-map.html

Read about Terence Tao's latest discovery: https://t.co/h8cMC9QKes

Wednesday, 14 September 2016

Lycrel Numbers

I've referred to the Lychrel numbers before in a couple of earlier posts but they always keep cropping up and a dedicated post will serve to remind of what they are, specifically a set of numbers that do not form a palindrome through the process of reversing and adding their digits. Of course, in base 10 it hasn't been proved that such numbers do not form palindromes somewhere down the iterative track but the first Lychrel number, 196, has been tested to a billion digits and no palindrome has been found. There is a site dedicated to these numbers: http://www.p196.org although it hasn't been updated in many years.

Wikipedia says that "about 80% of all numbers under 10,000 resolve into a palindrome in four or fewer steps. About 90% resolve in seven steps or fewer". The article goes to note that "89 takes an unusually large 24 iterations (the most of any number under 10,000 that is known to resolve into a palindrome) to reach the palindrome 8,813,200,023,188" and "10,911 reaches the palindrome 4668731596684224866951378664 (28 digits) after 55 steps". These statistics are relevant because the number of the day when I'm composing this post - 24636 - is a member of OEIS A06532053 'Reverse and Add' steps are needed to reach a palindrome

The first numbers in this sequence are:
10677, 11667, 12657, 13647, 14637, 15627, 16617, 17607, 20676, 21666, 22656, 23646, 24636, 25626, 26616, 27606, 30675, 31665, 32655, 33645, 34635, 35625, 36615, 37605, 40674, 41664, 42654, 43644, 44634, 45624, 46614, 47604, 50673
The various milestones when a number sets a new record for the number of 'Reverse and Add' steps needed to reach a palindrome are recorded in OEIS A065198. The first few such numbers are 0, 10, 19, 59, 69, 79, 89, 10548, 10677, 10833, 10911, 147996, 150296.

More information can be found on this site: https://www.dcode.fr/lychrel-number. A number is delayed when there a multiple steps before becoming a palindrome. The most delayed known is 1186060307891929990 with 261 iterations. 

There are potential Lychrel primes and the first three of these are 691, 887 and 1997. These primes form OEIS A135316:


 A135316

Primes
 in A023108(n); or Lychrel primes.                                


Here is a list of the initial members:
691, 887, 1997, 3583, 3673, 3853, 3943, 4079, 4259, 4349, 4799, 4889, 5581, 5851, 6257, 6977, 8089, 8179, 8269, 8539, 8629, 8719, 10663, 10883, 11777, 11833, 11867, 11923, 11953, 11959, 12097, 12763, 12823, 13397, 13523, 13553, 13597, 13633
on June 6th 2021

Wednesday, 22 June 2016

Remembering Reverse and Add, Palindromes and Trajectories

In an earlier post I commented on the reverse and add operation on numbers that usually leads to a palindrome e.g. 13 --> 31+13 --> 44, 26 --> 62+26 --> 88, 102 --> 201+102 --> 303 etc. However, some numbers (as far as can be determined) do not lead to palindromes under this operation. The first such number is 196. Here is a list of some such numbers taken from the OEIS A063048 entry:
196, 879, 1997, 7059, 10553, 10563, 10577, 10583, 10585, 10638, 10663, 10668, 10697, 10715, 10728, 10735, 10746, 10748, 10783, 10785, 10787, 10788, 10877, 10883, 10963, 10965, 10969, 10977, 10983, 10985, 12797, 12898, 13097, 13197, 13694
I've highlighted 10563 because my number for the day of this entry (24522) is connected to this number because it lies on its trajectory under the reverse and add operation. The list of such numbers defines OEIS A063064 (integers n > 10563 such that the 'Reverse and Add!' trajectory of n joins the trajectory of 10563) and begins thus:
11553, 12543, 13533, 14097, 14523, 15087, 15513, 16077, 16503, 17067, 18057, 18597, 19047, 19587, 20562, 21552, 22542, 24096, 24522, 25086, 25512, 26076, 26502, 27066, 28056, 28596, 29046, 29586, 30561, 31551, 32541, 33531, 34095 
Hence the title of this post. I was reminded about the reverse and add operation and how it mostly results in palindromes except for certain special "seed" numbers (such as 10563) that create seemingly endless "trajectories". It turns out that 24522 lies on the trajectory of 10563.

Below is an excerpt from the WolframMathWorld about what it terms the 196-Algorithm:
Take any positive integer of two digits or more, reverse the digits, and add to the original number. This is the operation of the reverse-then-add sequence. Now repeat the procedure with the sum so obtained until a palindromic number is obtained. This procedure quickly produces palindromic numbers for most integers. For example, starting with the number 5280 produces the sequence 5280, 6105, 11121, 23232. The end results of applying the algorithm to 1, 2, 3,  4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ... are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 33, 44, 55, 66, 77, 88, 99, 121, ... (OEIS A033865). The value for 89 is especially large, being 8813200023188. The first few numbers not known to produce palindromes, sometimes known as Lychrel numbers (Van Landingham), are 196, 295, 394, 493, 592, 689, 691, 788, 790, 879, 887, ... (OEIS A023108). 

Thursday, 7 January 2016

22, Reverse and Add

24384 is a member of OEIS A061561: Trajectory of 22 under the Reverse and Add! operation carried out in base 2. The terms of the sequence, up to and including 24384, are 22, 35, 84, 105, 180, 225, 360, 405, 744, 837, 1488, 1581, 3024, 3213, 6048, 6237, 12192, 12573, 24384. Even though the operations are carried out in base 2, the numbers of this sequence are shown in denary form. The actual base 2 sequence (OEIS A058042: Trajectory of binary number 10110 under the operation 'Reverse and Add!' carried out in base 2) looks like this: 

10110, 100011, 1010100, 1101001, 10110100, 11100001, 101101000, 110010101, 1011101000, 1101000101, 10111010000, 11000101101, 101111010000, 110010001101, 1011110100000, 1100001011101, 10111110100000 and on and on it goes ...

22 or 10110 is chosen as the first term because it is the smallest number whose base 2 trajectory does not contain a palindrome. So starting with 10110, the reverse is 01101 and 10110 + 11101 = 100011 and so it goes.

The equivalent sequence in base 10 starts with 196 because, according to this comment for OEIS A006960, 196 is conjectured to be the smallest initial term which does not lead to a palindrome. John Walker, Tim Irvin and others have extended the trajectory of 196 to millions of digits without finding a palindrome.

The Reverse and Add! sequence starting with 196 looks like this: 

196, 887, 1675, 7436, 13783, 52514, 94039, 187088, 1067869, 10755470, 18211171, 35322452, 60744805, 111589511, 227574622, 454050344, 897100798, 1794102596, 8746117567, 16403234045, 70446464506, 130992928913, 450822227944, 900544455998, 1800098901007 and on and on it goes ...

ADDENDUM (added 1st June 2019):
Most numbers do become palindromes fairly quickly under the reverse and add algorithm. OEIS A023109 shows the smallest number that requires exactly \(n\) iterations of Reverse and Add to reach a palindrome. The initial terms, up to \(n=55\) and starting with \(n=0\) are:

0, 10, 19, 59, 69, 166, 79, 188, 193, 1397, 829, 167, 2069, 1797, 849, 177, 1496, 739, 1798, 10777, 6999, 1297, 869, 187, 89, 10797, 10853, 10921, 10971, 13297, 10548, 13293, 17793, 20889, 700269, 106977, 108933, 80359, 13697, 10794, 15891, 1009227, 1007619, 1009246, 1008628, 600259, 131996, 70759, 1007377, 1001699, 600279, 141996, 70269, 10677, 10833, 10911


More information at this later blog post.