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=383303Another property of this palindrome is that it is the sum of two prime palindromes in two different ways:27872=11311+16561=12421+15451In 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:x=1±1+8x2Suppose we want to find the triangular root of 6. This gives:6=1±1+8×62=1±1+482=1±492=1±72=3  or4The formula arises from the definition of a triangular number x and the solution of the resulting quadratic equation:n(n+1)2=xn2+n2x=0n=1±1+8x2This method is no different to what we do when finding the square root of a number where we have:n2=xn=±xBy way of comparison it can be noted that triangular roots are only real if x1/8 whereas square roots are only real if x0. I can thank Dr. Barker's YouTube video for prompting this post. 

Figure 1 shows the situation for 6=n(n+1)2 where n=4 or 3.


Figure 1:  -4 and 3 are the values of 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=383303It'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:27937=333203=97396328063=313123=40333334209=333123=40331335208=33393=34316335929=33323=343153Notice 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=10631053I'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.117=3×3×13711=3×3×79When 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.126=2×3×3×7621=3×3×3×23 For k=5, there are 429 numbers starting with 270. Here is a permalink that will generate the numbers. Let's look at 270.270=2×3×3×3×572=2×2×2×3×3For 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:2576=24×7×236752=25×2112576, 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×1340431=13405650431Even a series of alternating 1's and 0's may also produce palindromes. For example:10101×1340431=13539693531However, such products of palindromes are NOT always palindromic. For example:11×1949999491=21449994401101×1949999491=1969499485911001×1940491=194243149110101×1940491=19600899591If all the digits of the second palindrome are less than 5 then the multiplication will always produce palindromes.