Lucky Palindromes with increasing factors: https://OEIS.org/A364050
​Lucky Palindromes with decreasing factors: https://OEIS.org/A364023
​Lucky palindromes: efficient search and results by Roman Maeder

Updated Results (see Original Article section below for context)

Summary of updates

There are three key updates that happen after I first published the idea of lucky palindromes:
◼
  • OEIS (On-Line Encyclopedia of Integer Sequences) has finally published the increasing- and decreasing- factors lucky palindrome sequences I submitted to them:
  • ◼
  • Increasing; https://oeis.org/A364050
  • ◼
  • Decreasing: https://oeis.org/A364023
  • ◼
  • Roman Maeder run a sophisticated optimized parallelized search and got the data for palindromes up to 21 digits. These data we consider below for visualizations. See Roman post here: Lucky palindromes: efficient search and results: https://community.wolfram.com/groups/-/m/t/2974426
  • ◼
  • Maximum number of factors found was 5.
  • ◼
  • Per Roman Maeder suggestion (see comments below) we now include single-factor lucky palindromes under condition that the factor is multiple (in power greater than 1). For instance 11*11=121 is included and considered a lucky palindrome. Palindromic primes are excluded because they are obvious and there is no “luck” per se occurring in combinations of factors, due to such numbers trivially containing only single non-multiple factor. Note not all single-multiple-palindrome-factor will give a palindrome, for example: 11^5=161051. Some examples:
  • ◼
  • 343 == 7^3
  • ◼
  • 14641 == 11^4
  • ◼
  • 12323244744232321 == 111010111^2
  • Now lets take a look at the results Roman Maeder found for palindromes up to 21 digits:

    The extended search and data for Lucky Palindromes

    From Roman Maeder post: https://community.wolfram.com/groups/-/m/t/2974426
    In[]:=
    results=
    ;
    The data represent both increasing- and decreasing factors sequences and have the following structure:
    In[]:=
    results//Shallow
    Out[]//Shallow=
    111{{},{37,3}},121{{11,11},{11,11}},343{{7,7,7},{7,7,7}},414{{},{23,3,3,2}},777{{},{37,7,3}},1331{{11,11,11},{11,11,11}},10001{{73,137},{}},10201{{101,101},{101,101}},14641{{11,11,11,11},{11,11,11,11}},35853{{},{37,19,17,3}},76
    which is an Association with left sub-list giving increasing factors and the right sub-list decreasing factors. Let’s split these results into only increasing factors lucky palindromes:
    In[]:=
    resI=Select[results,#[[1]]!={}&][[All,1]];​​resI//Length​​resI//Shallow
    Out[]=
    69
    Out[]//Shallow=
    121{11,11},343{7,7,7},1331{11,11,11},10001{73,137},10201{101,101},14641{11,11,11,11},36763{97,379},1030301{101,101,101},1037301{3,29,11923},1226221{1021,1201},59
    and decreasing factors lucky palindromes:
    In[]:=
    resD=Select[results,#[[2]]!={}&][[All,2]];​​resD//Length​​resD//Shallow
    Out[]=
    76
    Out[]//Shallow=
    111{37,3},121{11,11},343{7,7,7},414{23,3,3,2},777{37,7,3},1331{11,11,11},10201{101,101},14641{11,11,11,11},35853{37,19,17,3},1030301{101,101,101},66
    Note that for the same palindrome search within those with the number of digits up to 21, the number of Lucky Palindromes with increasing and decreasing factors is not the same -- 69 vs 76. For basic stats find numbers of factors in both sequences :
    In[]:=
    Flatten[Length/@Values[#]&/@{resI,resD}]
    Out[]=
    {2,3,3,2,2,4,2,3,3,2,3,4,2,5,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,3,2,2,3,4,3,3,2,4,4,3,2,2,3,3,4,5,2,2,3,3,2,2,2,2,2,3,4,2,2,2,2,2,2,3,4,2,2,2,2,2,2,2,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3}
    and count them:
    In[]:=
    Counts[factorDAT]//Sort
    Out[]=
    53,410,320,2112
    We do not have enough data for good statistics, but still it is interesting to see some shaping up probabilities:
    In[]:=
    Histogram[factorDAT,Automatic,"Probability",PlotTheme->"Detailed",FrameLabel->{"NUMBER of FACTORS","PROBABILITY"}]
    Out[]=
    Let’s see the number of factors plotted sequentially:
    In[]:=
    GraphicsColumnnumfacI=ListLinePlotLength/@Values[resI],
    ,​​numfacD=ListLinePlotLength/@Values[resD],
    ,ImageSize->500
    Out[]=
    Define functions that prints expansion in increasing and decreasing factors:
    In[]:=
    prntI[n_]:=Inactive[Equal][n,Inactive[Times]@@Flatten[Table[#1,#2]&@@@FactorInteger[n]]]
    In[]:=
    prntD[n_]:=Inactive[Equal][Inactive[Times]@@Flatten[Table[#1,#2]&@@@Reverse[FactorInteger[n]]],n]
    and use them to see the palindromes formed by the factors:
    In[]:=
    {prntI/@Keys[resI][[;;19]]//Column,Column[prntD/@Keys[resD][[;;19]],Alignment->Right]}
    Out[]=
    
    12111×11
    3437×7×7
    133111×11×11
    1000173×137
    10201101×101
    1464111×11×11×11
    3676397×379
    1030301101×101×101
    10373013×29×11923
    12262211021×1201
    93969393×101×31013
    104060401101×101×101×101
    12467976421111211×112111
    144328234413×3×281×313×18233
    939696969393×101×310131013
    11909229091111×9091×1190911
    10305070503011010201×1020101
    11202373202111000211×1120001
    12255595552211102111×1112011
    ,
    37×3111
    11×11121
    7×7×7343
    23×3×3×2414
    37×7×3777
    11×11×111331
    101×10110201
    11×11×11×1114641
    37×19×17×335853
    101×101×1011030301
    1201×10211226221
    79111×977673767
    3119×191×137744477
    31013×101×39396939
    101×101×101×101104060401
    2731×199×113×7×2859767958
    3737303737×311211911211
    112111×11121112467976421
    104147×1741×40172709290727
    

    Visualisation

    To understand how to build a detailed visualisation, I give a complete code here with all the styling details. This is the main graphics:
    In[]:=
    plotFIN=Show[ListPlot[{Callout/@Keys[resI],Callout/@Keys[resD]},​​PlotTheme->"Detailed",PlotMarkers->{"OpenMarkers",8},​​ScalingFunctions->{"Log","Log"},Joined->True,AspectRatio->1,​​PlotLegends->Placed[{"increasing factors","decreasing factors"},Above],​​FrameLabel->{"SEQUENCE INDEX (log-scale)","PALINDROME VALUE (log-scale)"},ImageSize->800,BaseStyle->14,​​PlotRangePadding->{{Automatic,Automatic},{Automatic,Scaled[.08]}},​​Epilog->{​​Inset[Style["Designed by Vitaliy Kaurov",15,Darker@Red,Italic],Scaled[{.015,.01}],{Left,Bottom}],​​Inset[numfacI,Scaled[{.01,.98}],{Left,Top},Scaled[.5]],​​Inset[numfacD,Scaled[{.01,.78}],{Left,Top},Scaled[.5]],​​Inset[Column[prntI/@Reverse[Keys[resI][[;;23]]]],Scaled[{.015,.57}],{Left,Top}],​​Inset[Column[prntD/@Keys[resD][[;;23]],Alignment->Right],Scaled[{.98,.02}],{Right,Bottom}]}​​],ImageSize->1000];
    This is text used in sub-caption:
    Palindromes whose sorted concatenated prime factors also form palindromes. Within 100s of millions of palindromes checked only a few are “lucky”. Inset plots show numbers of factors vs sequence index.
    This assembles everything together:

    Double-Lucky Palindromes

    Interestingly enough, there are palindromes whose concatenated factors form palindromes sorted in either direction -- ascending and descending:
    Define a function that prints this to visually confirm the observation:
    Intuitively, Double-Lucky Palindromes do not have many factors.

    Original article

    Consider a palindrome integer such as 10001. Observe that its 2 prime factors 73*137 from a palindrome when sorted in increasing order. Another example is palindrome 9396939 with its 3 sorted prime factors forming a palindrome 3*101*31013. Or we could order factors decreasingly and find similar like 414==23*3*3*2. Note, we are listing multiplicity of a factor explicitly 3*3 and not writing it as 3^2. Such numbers are relatively rare. They require a sort of “coincidence” of sorted prime factors to have digits to form a palindrome. I was interested in seeing how many of these I can find and what properties they will have. Note, we are not considering trivial cases with a single prime factor even if the factor has multiplicity, for instance 121 = 11*11. There are many cases like this and it is obvious how they are formed -- there is no “coincidence” there per se. Also, obviously, the number base matters for palindromes and the work here is true only for base 10. To summarize, we are looking for the numbers satisfying the following criteria:
    ◼
  • Number is a composite palindrome integer in base 10
  • ◼
  • Number has at least 2 distinct prime factors
  • ◼
  • Number’s factors sorted in ascending or descending order and concatenated form a palindrome
  • Within roughly ~110 million first palindromes with up to 15 digits only 19 and 28 such “lucky” palindromes exist (for factors written in ascending and descending order correspondingly). These sequences are shown on the image below (with insets showing the number of prime factors for each number in the sequences):
    These few first computed terms have at most 5 factors. Considering the poorly-small (for stats) dataset, the observed probability of occurrence of n-factors in either sequence (ascending or descending) is:
    So first 2 questions I have are:
    ◼
  • Can we find Lucky Palindromes with 7 or more factors? I think we might be close to 6 factors if we find a bit more Lucky Palindromes. But the quest for 7 factors looks rather daunting and is a bit more mysterious and exciting, especially considering the symbolic and favorable views on 7 in Western and many other cultures.
  • ◼
  • Can the code be optimized to find significantly more Lucky Palindromes? As this is what is needed to help answering 1st question computationally.
  • On my simple Mac laptop it took me many hours to find all first Lucky Palindromes among roughly ~110 million palindromes with up to 15 digits. Can we do better?

    Code to find the sequence for ascending factors

    Define a function that generates palindromes of a given size (number of digits):
    For example all palindromes of size 3:
    This is how many palindromes exists with the size up to 15 digits:
    Define a function that finds the palindromes whose ascending concatenated prime factors form a palindrome:
    E.g. find Lucky Palindromes among all palindromes of size 7:
    These are all 19 palindromes with ascending factors forming a palindrome I was able to find among roughly ~110 million palindromes with up to 15 digits:
    Define function that counts factors:
    The number of factors counting multiplicity:
    Define function that prints expansion in increasing factors:
    and use it to see the palindromes formed by the factors:

    Code to find the sequence for descending factors

    Let’s repeat the same computations analogically here. All-palindrome generating functions remain the same. But we need a new function to search the palindromes whose descending concatenated prime factors form a palindrome:
    These are all 28 such palindromes I was able to find among roughly ~110 million palindromes with up to 15 digits:
    The number of factors counting multiplicity:
    Define function that prints expansion in decreasing factors:
    and use it to see the palindromes formed by the factors:

    Double-Lucky Palindromes

    Interestingly enough, there are palindromes whose concatenated factors form palindromes sorted in either direction -- ascending and descending:
    Define a function that prints this to visually confirm the observation:
    Intuitively, Double-Lucky Palindromes do not have many factors.

    Stats

    For basic stats find numbers of factors in both sequences :
    and count them:
    We do not have good numbers for proper statistics, but still it is interesting to see some shaping up probabilities:

    Visualisation

    To understand how to build a detailed visualisation, I give a complete code here with all the styling details. This is the main graphics:
    This is text used in sub-caption:
    Palindromes whose multiple sorted concatenated prime factors also form palindromes. Within roughly 110 million first palindromes with up to 15 digits only 19 and 28 such “lucky” palindromes exist for factors written in ascending and descending order correspondingly. Inset plots show numbers of factors vs sequence index.
    THis assembles everything together:

    CITE THIS NOTEBOOK

    Lucky Palindromes: when do prime factors of palindromes make palindromes?​
    by Vitaliy Kaurov​
    Wolfram Community, STAFF PICKS, July 13, 2023
    ​https://community.wolfram.com/groups/-/m/t/2961701