Thursday 24 August 2023

Sum of Digits Cubed to the Rescue

Just as I struggled with finding something of interest about 27164, as reported in my post titled Circulant Matrix to the Rescue, I similarly struggled in finding something of interest about 27168. This really bugged me but try as I may I could not find anything really interesting after several days of trying.

Finally however, after playing around with the individual digits of the numbers on either side of 27168, I noticed that the sum of digits cubed ( \( \text{SOD}^3\)) were both prime. Specifically I discovered that:$$ \begin{align} 27167 \rightarrow 2^3+7^3+1^3+6^3+7^3 &= 911\\27169 \rightarrow 2^3+7^3+1^3+6^3+9^3 &= 1297 \end{align} $$Both 911 and 1297 are prime but the \( \text{SOD}^3\) of 27168 is not because we have:$$27168 \rightarrow 2^3+7^3+1^3+6^3+8^3 = 1080$$It is very rare to have three numbers in a row whose \( \text{SOD}^3\) are prime. In the range up to one million, there are only four such groups of three numbers with the middle numbers being 1100, 10100, 100100 and 110000 and all having 2 as their \( \text{SOD}^3\). For example, take the group 1099, 1100 and 1101 where we have:$$ \begin{align} 1099 \rightarrow 1^3 + 0^3+9^3+9^3 &=1459\\1100 \rightarrow 1^3 + 1^3+0^3+0^3 &=2\\1101 \rightarrow 1^3 + 1^3+0^3+1^3 &= 3 \end{align}$$So having three numbers in a row whose \( \text{SOD}^3\)s are prime is hardly an interesting sequence but what about numbers like 27168 with adjacent numbers that have this property.  Well, up to one million, there are 22045 such numbers representing 2.2045% of the range (permalink). I won't list them all here but up to 40,000, the 1137 numbers are (permalink):

112, 114, 123, 147, 165, 183, 213, 222, 237, 255, 264, 282, 288, 297, 327, 336, 354, 363, 417, 462, 486, 495, 525, 534, 552, 567, 576, 585, 615, 624, 633, 642, 657, 693, 756, 783, 813, 822, 828, 846, 855, 873, 888, 927, 945, 963, 996, 1012, 1014, 1023, 1047, 1065, 1083, 1102, 1104, 1111, 1113, 1122, 1128, 1131, 1146, 1173, 1203, 1212, 1218, 1272, 1311, 1377, 1407, 1416, 1443, 1494, 1500, 1593, 1605, 1713, 1722, 1737, 1782, 1803, 1872, 1944, 1953, 2013, 2022, 2037, 2055, 2064, 2082, 2088, 2097, 2103, 2112, 2118, 2172, 2202, 2226, 2271, 2307, 2343, 2400, 2433, 2442, 2475, 2505, 2556, 2574, 2583, 2604, 2712, 2721, 2745, 2754, 2802, 2808, 2853, 2907, 3027, 3036, 3054, 3063, 3111, 3177, 3207, 3243, 3306, 3375, 3384, 3423, 3498, 3504, 3603, 3663, 3672, 3717, 3735, 3762, 3834, 3900, 3948, 3993, 4017, 4062, 4086, 4095, 4107, 4116, 4143, 4194, 4200, 4233, 4242, 4275, 4323, 4398, 4413, 4422, 4581, 4602, 4725, 4806, 4851, 4905, 4914, 4938, 4992, 5025, 5034, 5052, 5067, 5076, 5085, 5100, 5193, 5205, 5256, 5274, 5283, 5304, 5481, 5502, 5526, 5553, 5571, 5607, 5667, 5706, 5724, 5751, 5805, 5823, 5841, 5913, 6015, 6024, 6033, 6042, 6057, 6093, 6105, 6204, 6303, 6363, 6372, 6402, 6507, 6567, 6633, 6657, 6666, 6675, 6684, 6732, 6765, 6864, 6903, 7056, 7083, 7113, 7122, 7137, 7182, 7212, 7221, 7245, 7254, 7317, 7335, 7362, 7425, 7506, 7524, 7551, 7632, 7665, 7803, 7812, 7887, 8013, 8022, 8028, 8046, 8055, 8073, 8088, 8103, 8172, 8202, 8208, 8253, 8334, 8400, 8406, 8451, 8505, 8523, 8541, 8664, 8703, 8712, 8787, 8808, 8877, 9027, 9045, 9063, 9096, 9144, 9153, 9207, 9348, 9393, 9405, 9414, 9438, 9492, 9513, 9603, 9900, 9906, 9933, 9942, 10012, 10014, 10023, 10047, 10065, 10083, 10102, 10104, 10111, 10113, 10122, 10128, 10131, 10146, 10173, 10203, 10212, 10218, 10272, 10311, 10377, 10407, 10416, 10443, 10494, 10500, 10593, 10605, 10713, 10722, 10737, 10782, 10803, 10872, 10944, 10953, 11002, 11004, 11011, 11013, 11022, 11028, 11031, 11046, 11073, 11101, 11103, 11112, 11118, 11121, 11127, 11145, 11163, 11172, 11202, 11208, 11211, 11217, 11244, 11301, 11334, 11343, 11367, 11400, 11406, 11415, 11424, 11433, 11442, 11451, 11499, 11541, 11592, 11613, 11637, 11697, 11703, 11712, 11895, 11952, 11967, 11985, 12003, 12012, 12018, 12072, 12102, 12108, 12111, 12117, 12144, 12225, 12261, 12333, 12342, 12348, 12393, 12399, 12414, 12432, 12438, 12474, 12582, 12621, 12678, 12687, 12702, 12744, 12768, 12852, 12867, 12885, 12900, 12933, 13011, 13077, 13101, 13134, 13143, 13167, 13200, 13233, 13242, 13248, 13293, 13314, 13323, 13332, 13413, 13422, 13428, 13446, 13455, 13473, 13491, 13545, 13617, 13662, 13707, 13743, 13923, 13941, 14007, 14016, 14043, 14094, 14100, 14106, 14115, 14124, 14133, 14142, 14151, 14199, 14214, 14232, 14238, 14274, 14313, 14322, 14328, 14346, 14355, 14373, 14391, 14403, 14412, 14436, 14445, 14454, 14463, 14487, 14496, 14511, 14535, 14544, 14643, 14685, 14724, 14733, 14847, 14865, 14883, 14904, 14931, 14946, 14991, 15093, 15099, 15141, 15192, 15282, 15345, 15411, 15435, 15444, 15576, 15756, 15774, 15822, 15888, 15897, 15903, 15912, 15987, 16005, 16113, 16137, 16197, 16221, 16278, 16287, 16317, 16362, 16443, 16485, 16599, 16632, 16683, 16728, 16773, 16791, 16827, 16845, 16863, 16896, 16917, 16971, 16986, 17013, 17022, 17037, 17082, 17103, 17112, 17202, 17244, 17268, 17307, 17343, 17424, 17433, 17556, 17574, 17628, 17673, 17691, 17754, 17763, 17778, 17802, 17961, 18003, 18072, 18195, 18252, 18267, 18285, 18300, 18447, 18465, 18483, 18522, 18588, 18597, 18627, 18645, 18663, 18696, 18702, 18825, 18843, 18858, 18885, 18915, 18957, 18966, 19044, 19053, 19152, 19167, 19185, 19233, 19299, 19323, 19341, 19404, 19431, 19446, 19491, 19503, 19512, 19587, 19617, 19671, 19686, 19761, 19815, 19857, 19866, 19941, 19998, 20013, 20022, 20037, 20055, 20064, 20082, 20088, 20097, 20103, 20112, 20118, 20172, 20202, 20226, 20271, 20307, 20343, 20400, 20433, 20442, 20475, 20505, 20556, 20574, 20583, 20604, 20712, 20721, 20745, 20754, 20802, 20808, 20853, 20907, 21003, 21012, 21018, 21072, 21102, 21108, 21111, 21117, 21144, 21225, 21261, 21333, 21342, 21348, 21393, 21399, 21414, 21432, 21438, 21474, 21582, 21621, 21678, 21687, 21702, 21744, 21768, 21852, 21867, 21885, 21900, 21933, 22002, 22026, 22071, 22125, 22161, 22206, 22215, 22224, 22251, 22284, 22332, 22383, 22446, 22455, 22473, 22482, 22521, 22545, 22578, 22581, 22611, 22701, 22743, 22758, 22824, 22833, 22842, 22851, 23007, 23043, 23100, 23133, 23142, 23148, 23193, 23199, 23232, 23283, 23313, 23322, 23331, 23403, 23412, 23418, 23445, 23454, 23487, 23496, 23544, 23553, 23676, 23700, 23766, 23799, 23823, 23847, 23892, 23913, 23946, 23982, 24033, 24042, 24075, 24114, 24132, 24138, 24174, 24246, 24255, 24273, 24282, 24303, 24312, 24318, 24345, 24354, 24387, 24396, 24402, 24426, 24435, 24462, 24471, 24486, 24525, 24534, 24594, 24642, 24705, 24714, 24723, 24741, 24798, 24822, 24837, 24846, 24882, 24936, 24954, 24978, 25005, 25056, 25074, 25083, 25182, 25221, 25245, 25278, 25281, 25344, 25353, 25425, 25434, 25494, 25506, 25533, 25599, 25704, 25728, 25773, 25803, 25812, 25821, 25887, 25944, 26004, 26121, 26178, 26187, 26211, 26376, 26442, 26718, 26736, 26772, 26817, 27012, 27021, 27045, 27054, 27102, 27144, 27168, 27201, 27243, 27258, 27366, 27405, 27414, 27423, 27441, 27498, 27504, 27528, 27573, 27618, 27636, 27672, 27753, 27762, 27948, 28002, 28008, 28053, 28152, 28167, 28185, 28224, 28233, 28242, 28251, 28323, 28347, 28392, 28422, 28437, 28446, 28482, 28503, 28512, 28521, 28587, 28617, 28815, 28842, 28857, 28884, 28899, 28932, 29007, 29133, 29313, 29346, 29382, 29436, 29454, 29478, 29544, 29748, 29832, 29997, 30027, 30036, 30054, 30063, 30111, 30177, 30207, 30243, 30306, 30375, 30384, 30423, 30498, 30504, 30603, 30663, 30672, 30717, 30735, 30762, 30834, 30900, 30948, 30993, 31011, 31077, 31101, 31134, 31143, 31167, 31200, 31233, 31242, 31248, 31293, 31314, 31323, 31332, 31413, 31422, 31428, 31446, 31455, 31473, 31491, 31545, 31617, 31662, 31707, 31743, 31923, 31941, 32007, 32043, 32100, 32133, 32142, 32148, 32193, 32199, 32232, 32283, 32313, 32322, 32331, 32403, 32412, 32418, 32445, 32454, 32487, 32496, 32544, 32553, 32676, 32700, 32766, 32799, 32823, 32847, 32892, 32913, 32946, 32982, 33006, 33075, 33084, 33114, 33123, 33132, 33213, 33222, 33231, 33312, 33321, 33354, 33381, 33453, 33468, 33495, 33534, 33543, 33558, 33600, 33648, 33675, 33684, 33699, 33705, 33765, 33804, 33831, 33864, 33945, 34023, 34098, 34113, 34122, 34128, 34146, 34155, 34173, 34191, 34203, 34212, 34218, 34245, 34254, 34287, 34296, 34353, 34368, 34395, 34416, 34425, 34443, 34452, 34467, 34494, 34515, 34524, 34533, 34542, 34557, 34593, 34638, 34647, 34665, 34683, 34713, 34791, 34827, 34863, 34908, 34911, 34926, 34935, 34944, 34953, 34971, 35004, 35145, 35244, 35253, 35334, 35343, 35358, 35415, 35424, 35433, 35442, 35457, 35493, 35523, 35538, 35547, 35565, 35583, 35655, 35682, 35688, 35778, 35853, 35862, 35868, 35943, 36003, 36063, 36072, 36117, 36162, 36276, 36300, 36348, 36375, 36384, 36399, 36438, 36447, 36465, 36483, 36555, 36582, 36588, 36603, 36612, 36645, 36663, 36687, 36702, 36726, 36735, 36771, 36834, 36843, 36852, 36858, 36867, 36894, 36984, 37017, 37035, 37062, 37107, 37143, 37266, 37299, 37305, 37365, 37413, 37491, 37578, 37602, 37626, 37635, 37671, 37758, 37761, 37776, 37941, 38034, 38100, 38223, 38247, 38292, 38304, 38331, 38364, 38427, 38463, 38553, 38562, 38568, 38634, 38643, 38652, 38658, 38667, 38694, 38700, 38883, 38922, 38964, 39048, 39093, 39099, 39123, 39141, 39213, 39246, 39282, 39345, 39408, 39411, 39426, 39435, 39444, 39453, 39471, 39543, 39684, 39741, 39822, 39864, 39903, 39996

So next time I get stuck on a number with seemingly no interesting properties I have this \( \text{SOD}^3\) property to call on as well as the determinant of the number's circulant matrix.

Monday 21 August 2023

Circulant Matrix to the Rescue

I was stuck for several days on a number associated with my diurnal age: 27164. I couldn't anything of interest about this number, or at least nothing that interested me. In the end, I remembered the circulant matrix that is associated with each number. For the case of 27164 this matrix is shown below. $$ \begin{pmatrix}2&7&1&6&4\\4&2&7&1&6\\6&4&2&7&1\\1&6&4&2&7\\7&1&6&4&2 \end{pmatrix}$$The determinant of this matrix is 100 and there are only 89 numbers in the range up to one million that have 100 as their determinant. These numbers are:

799, 979, 997, 12674, 14762, 16427, 17246, 21476, 23564, 24617, 24653, 25436, 26345, 26741, 27164, 32465, 33455, 33554, 34445, 34454, 34526, 34535, 34544, 34553, 35345, 35354, 35435, 35444, 35543, 35642, 36254, 41267, 42356, 42716, 43355, 43445, 43454, 43535, 43544, 43625, 44345, 44354, 44435, 44453, 44534, 44543, 45263, 45344, 45353, 45434, 45443, 45533, 46172, 46532, 47621, 52634, 53246, 53345, 53444, 53453, 53534, 53543, 54335, 54344, 54353, 54362, 54434, 54443, 55334, 55433, 56423, 61724, 62147, 62543, 63452, 64235, 64271, 65324, 67412, 71642, 72461, 74126, 76214, 303040, 304030, 403030, 889898, 988898, 989888

Of these, many are permutations of the digits of 27164. These permutations are shown below in bold with 27164 itself marked in red.

12467, 12476, 12647, 12674, 12746, 12764, 14267, 14276, 14627, 14672, 14726, 14762, 16247, 16274, 16427, 16472, 16724, 16742, 17246, 17264, 17426, 17462, 17624, 17642, 21467, 21476, 21647, 21674, 21746, 21764, 24167, 24176, 24617, 24671, 24716, 24761, 26147, 26174, 26417, 26471, 26714, 26741, 27146, 27164, 27416, 27461, 27614, 27641, 41267, 41276, 41627, 41672, 41726, 41762, 42167, 42176, 42617, 42671, 42716, 42761, 46127, 46172, 46217, 46271, 46712, 46721, 47126, 47162, 47216, 47261, 47612, 47621, 61247, 61274, 61427, 61472, 61724, 61742, 62147, 62174, 62417, 62471, 62714, 62741, 64127, 64172, 64217, 64271, 64712, 64721, 67124, 67142, 67214, 67241, 67412, 67421, 71246, 71264, 71426, 71462, 71624, 71642, 72146, 72164, 72416, 72461, 72614, 72641, 74126, 74162, 74216, 74261, 74612, 74621, 76124, 76142, 76214, 76241, 76412, 76421

Admittedly, focusing on a determinant of 100 is rather arbitrary, but it is a nice round number and it certainly came to my aid in finding an interesting property of 27164. This prompted me to investigate the range of values for the determinants in the natural numbers up to 40,000. It turns out the minimum value of -19683 occurs with 9909 and the maximum value of 205821 occurs with 30990 and 39009. Figure 1 shows a plot of the values of the determinants.


Figure 1: permalink

As can be seen it is four digit numbers from 1000 up to 9999 that fluctuate between positive and negative. The three digit numbers and the five digit numbers up to 40000 are all positive. The positive/negative fluctuations recur once the six digit numbers are reached. This is to be expected of course given the way the determinant is calculated. Figure 2 a close up of the range from 10 to 10000.


Figure 2: permalink

Monday 14 August 2023

Biprimes and Permutations

I got to thinking today about biprimes, or semiprimes as they are also called, and how many have factors that are reversals of each other. Well, it doesn't take long to work that out using this code. Figure 1 shows the results up to one million (there are 18 numbers):


Figure 1

These numbers form part of OEIS A083815:


 A083815

Semiprimes whose prime factors are distinct and the reversal of one factor is equal to the other.


An extension of this idea to consider factors in which the digits of both factors are the same but permutations of each other. This would include all the numbers in OEIS A083815. Figure 2 shows the 79 numbers up to one million together with their factorisations (permalink):


Figure 2

Here are the numbers listed without the factorisation:

403, 1207, 2701, 7663, 14803, 23701, 26827, 34417, 35143, 35263, 40741, 43429, 54841, 62431, 70027, 73159, 75007, 89647, 99919, 101461, 102853, 103039, 103603, 117907, 125701, 127087, 128701, 130771, 140209, 141643, 146791, 150463, 153211, 173809, 174001, 182881, 191287, 197209, 201379, 205729, 212887, 230701, 232909, 246991, 247021, 249979, 257821, 273409, 280081, 293383, 295501, 297709, 302149, 326371, 342127, 355123, 367639, 371989, 374971, 382387, 386803, 394279, 427729, 428821, 436789, 453613, 462031, 469537, 503059, 565129, 589429, 643063, 690199, 692443, 698149, 743623, 778669, 824737, 910729

This sequence is not in the OEIS.

Sunday 13 August 2023

Per Nørgård's Infinity Sequence

The number associated with my diurnal yesterday (27159) has a property that qualifies it for inclusion in OEIS A083866:


 A083866

Positions of zeros in Per Nørgård's infinity sequence (A004718).                 



This naturally led me find out what the Per Nørgård's infinity sequence was all about. So let's look at OEIS A004718.


A004718

The Danish composer Per Nørgård's "infinity sequence", invented in an attempt to unify in a perfect way repetition and variation: a(2\(n\)) = -a(\(n\)), a(2\(n\)+1) = a(\(n\)) + 1, a(0) = 0.



The first one hundred terms are:

0, 1, -1, 2, 1, 0, -2, 3, -1, 2, 0, 1, 2, -1, -3, 4, 1, 0, -2, 3, 0, 1, -1, 2, -2, 3, 1, 0, 3, -2, -4, 5, -1, 2, 0, 1, 2, -1, -3, 4, 0, 1, -1, 2, 1, 0, -2, 3, 2, -1, -3, 4, -1, 2, 0, 1, -3, 4, 2, -1, 4, -3, -5, 6, 1, 0, -2, 3, 0, 1, -1, 2, -2, 3, 1, 0, 3, -2, -4, 5, 0, 1, -1, 2, 1, 0, -2, 3, -1, 2, 0, 1, 2, -1, -3, 4, -2, 3, 1, 0

The maximum is 6 and the minimum is -5. If we extend the number of terms to 10,000, the maximum is 13 and the minimum is -12. Extending to one million returns a maximum of 19 and a minimum of -18. Figure 1 shows a graph of the first one hundred terms.


Figure 1: permalink

There's an extensive literature out there regarding this sequence and the music associated with it but I won't go into that here. This is post is just to reference the sequence and explain how the terms are generated.

Wednesday 9 August 2023

Gray Code to the Rescue

Try as I might to find something interesting about the numerical properties of 27155, the number associated with my diurnal age yesterday, I couldn't. I looked through all my usual sources and spent quite time wracking my brain. Eventually I focused on the number's Gray Code. Follow the link for more information.

Because there is a 1-to-1 correspondence between a number and its Gray Code, I thought I'd look at the absolute value of the difference between the two. In the case of 27155, its Gray Code is 24346 and the difference is 2809. Fortunately, this number happens to be a perfect square \(53^2\). How often is this difference a perfect square was the next question that I asked myself.

It turns out that there are 359 such numbers in the range up to 40000. This represents 0.8975% of the range and so such numbers are relatively rare. Here is the list:

1, 2, 3, 6, 8, 9, 18, 24, 25, 32, 33, 47, 51, 54, 72, 73, 79, 96, 97, 128, 129, 159, 162, 211, 214, 216, 217, 227, 230, 271, 288, 289, 306, 338, 384, 385, 419, 422, 512, 513, 575, 578, 648, 649, 703, 706, 751, 787, 790, 856, 857, 864, 865, 883, 886, 920, 921, 1058, 1119, 1152, 1153, 1224, 1225, 1311, 1352, 1353, 1378, 1423, 1458, 1490, 1536, 1537, 1603, 1606, 1688, 1689, 1731, 1734, 1779, 1782, 1827, 1830, 1971, 1974, 2048, 2049, 2175, 2178, 2312, 2313, 2431, 2434, 2592, 2593, 2824, 2825, 3160, 3161, 3171, 3174, 3219, 3222, 3424, 3425, 3456, 3457, 3544, 3545, 3680, 3681, 3763, 3766, 3939, 3942, 3987, 3990, 4083, 4086, 4207, 4232, 4233, 4306, 4418, 4608, 4609, 4896, 4897, 5202, 5408, 5409, 5512, 5513, 5570, 5775, 5810, 5832, 5833, 5960, 5961, 6002, 6034, 6063, 6144, 6145, 6275, 6278, 6424, 6425, 6531, 6534, 6739, 6742, 6752, 6753, 6936, 6937, 7128, 7129, 7283, 7286, 7320, 7321, 7491, 7494, 7843, 7846, 7896, 7897, 7987, 7990, 8192, 8193, 8447, 8450, 8712, 8713, 8959, 8962, 9248, 9249, 9551, 9736, 9737, 10063, 10143, 10368, 10369, 10466, 10655, 10975, 11296, 11297, 11506, 11538, 11567, 11791, 11826, 12095, 12223, 12640, 12641, 12696, 12697, 12739, 12742, 12888, 12889, 13347, 13350, 13651, 13654, 13696, 13697, 13824, 13825, 14176, 14177, 14307, 14310, 14499, 14502, 14720, 14721, 14819, 14822, 15064, 15065, 15768, 15769, 15859, 15862, 15960, 15961, 16344, 16345, 16754, 16928, 16929, 17224, 17225, 17672, 17673, 17810, 17839, 17951, 18018, 18210, 18271, 18432, 18433, 19071, 19327, 19584, 19585, 20079, 20178, 20290, 20418, 20594, 20687, 20808, 20809, 21632, 21633, 22048, 22049, 22280, 22281, 22402, 22671, 22706, 23240, 23241, 23328, 23329, 23567, 23602, 23840, 23841, 24008, 24009, 24136, 24137, 24306, 24338, 24367, 24576, 24577, 24835, 24838, 25112, 25113, 25347, 25350, 25696, 25697, 26136, 26137, 26968, 26969, 27008, 27009, 27155, 27158, 27603, 27606, 27744, 27745, 27955, 27958, 28115, 28118, 28512, 28513, 28755, 28758, 29144, 29145, 29280, 29281, 29976, 29977, 30131, 30134, 31091, 31094, 31384, 31385, 31584, 31585, 31960, 31961, 32307, 32310, 32768, 32769, 33279, 33282, 33800, 33801, 34303, 34306, 34848, 34849, 35407, 35848, 35849, 36431, 36992, 36993, 37346, 37538, 38367, 38559, 38944, 38945, 39410, 39442, 39471

Looking at the numbers in this list, it is apparent that many of them occur in pairs or separated by 3. For example, the next number after 27155 is 27158 which has to do with the changing of the binary digits. I've added this sequence of numbers to my Bespoken for Sequences database as S085:

A variation on this idea is to consider those numbers whose difference with their Gray Code equivalents is a cube. There are 82 such numbers in the range up 40000. I've added this sequence of numbers to my Bespoken for Sequences database as S087:

The list is:

1, 2, 3, 6, 16, 17, 48, 49, 78, 91, 128, 129, 202, 215, 254, 263, 282, 384, 385, 624, 625, 779, 1024, 1025, 1616, 1617, 1775, 2032, 2033, 2256, 2257, 2718, 3072, 3073, 3410, 3706, 4394, 4855, 4992, 4993, 6739, 6742, 7079, 7903, 8192, 8193, 10722, 11747, 11750, 12928, 12929, 13115, 13166, 15850, 16256, 16257, 18048, 18049, 18618, 20091, 21744, 21745, 22503, 23470, 24223, 24576, 24577, 26531, 26534, 27280, 27281, 27554, 29648, 29649, 32307, 32310, 35152, 35153, 39442, 39471, 39936, 39937

The numbers together with their Gray Code equivalents, differences and cube root of differences are shown below:

[(1, 1, 0, 0), (2, 3, 1, 1), (3, 2, 1, 1), (6, 5, 1, 1), (16, 24, 8, 2), (17, 25, 8, 2), (48, 40, 8, 2), (49, 41, 8, 2), (78, 105, 27, 3), (91, 118, 27, 3), (128, 192, 64, 4), (129, 193, 64, 4), (202, 175, 27, 3), (215, 188, 27, 3), (254, 129, 125, 5), (263, 388, 125, 5), (282, 407, 125, 5), (384, 320, 64, 4), (385, 321, 64, 4), (624, 840, 216, 6), (625, 841, 216, 6), (779, 654, 125, 5), (1024, 1536, 512, 8), (1025, 1537, 512, 8), (1616, 1400, 216, 6), (1617, 1401, 216, 6), (1775, 1432, 343, 7), (2032, 1032, 1000, 10), (2033, 1033, 1000, 10), (2256, 3256, 1000, 10), (2257, 3257, 1000, 10), (2718, 4049, 1331, 11), (3072, 2560, 512, 8), (3073, 2561, 512, 8), (3410, 3067, 343, 7), (3706, 2375, 1331, 11), (4394, 6591, 2197, 13), (4855, 7052, 2197, 13), (4992, 6720, 1728, 12), (4993, 6721, 1728, 12), (6739, 6010, 729, 9), (6742, 6013, 729, 9), (7079, 5748, 1331, 11), (7903, 4528, 3375, 15), (8192, 12288, 4096, 16), (8193, 12289, 4096, 16), (10722, 15635, 4913, 17), (11747, 15122, 3375, 15), (11750, 15125, 3375, 15), (12928, 11200, 1728, 12), (12929, 11201, 1728, 12), (13115, 10918, 2197, 13), (13166, 10969, 2197, 13), (15850, 8991, 6859, 19), (16256, 8256, 8000, 20), (16257, 8257, 8000, 20), (18048, 26048, 8000, 20), (18049, 26049, 8000, 20), (18618, 27879, 9261, 21), (20091, 26950, 6859, 19), (21744, 32392, 10648, 22), (21745, 32393, 10648, 22), (22503, 31764, 9261, 21), (23470, 30329, 6859, 19), (24223, 29136, 4913, 17), (24576, 20480, 4096, 16), (24577, 20481, 4096, 16), (26531, 21618, 4913, 17), (26534, 21621, 4913, 17), (27280, 24536, 2744, 14), (27281, 24537, 2744, 14), (27554, 24179, 3375, 15), (29648, 19000, 10648, 22), (29649, 19001, 10648, 22), (32307, 16682, 15625, 25), (32310, 16685, 15625, 25), (35152, 52728, 17576, 26), (35153, 52729, 17576, 26), (39442, 55067, 15625, 25), (39471, 55096, 15625, 25), (39936, 53760, 13824, 24), (39937, 53761, 13824, 24)]

Another idea is to look at all those numbers whose Gray Codes are simply permutations of the number's original digits. It turns out that there are only 48 numbers with this property in the range up to 40000. I've added this sequence of numbers to my Bespoken for Sequences database as S086:


The list is as follows:

1, 54, 1126, 1488, 1489, 1636, 1637, 1746, 1812, 1813, 2351, 3272, 3273, 3492, 3624, 3625, 4356, 4659, 6544, 6545, 6902, 6985, 7051, 7248, 7249, 7520, 7550, 14184, 14185, 15041, 15101, 23500, 23501, 24219, 24907, 25173, 26519, 26635, 27402, 28213, 28292, 28293, 31428, 32157, 34305, 35258, 35380, 35411

Here are the numbers together with the permutated digits:

(1, 1), (54, 45), (1126, 1621), (1488, 1848), (1489, 1849), (1636, 1366), (1637, 1367), (1746, 1467), (1812, 1182), (1813, 1183), (2351, 3512), (3272, 2732), (3273, 2733), (3492, 2934), (3624, 2364), (3625, 2365), (4356, 6534), (4659, 6954), (6544, 5464), (6545, 5465), (6902, 6029), (6985, 5869), (7051, 5710), (7248, 4728), (7249, 4729), (7520, 5072), (7550, 5057), (14184, 11484), (14185, 11485), (15041, 10145), (15101, 10115), (23500, 30250), (23501, 30251), (24219, 29142), (24907, 20974), (25173, 21375), (26519, 21596), (26635, 23566), (27402, 24207), (28213, 22831), (28292, 22982), (28293, 22983), (31428, 18342), (32157, 17235), (34305, 50433), (35258, 52583), (35380, 53038), (35411, 53114)

Sunday 6 August 2023

Hidden Beast Numbers

The number associated with my diurnal age today, 27153, gave me the idea for what I'm terming "hidden beast numbers". This number factorises to 3 x 3 x 7 x 431 and its sum of prime factors, with multiplicity, is 444. This prompted with to find all numbers whose sum of prime factors have identical digits. This sequence does not appear in the OEIS but I added it to my Bespoken for Sequences.

However, in this post I'm only interested those numbers whose sum of prime factors is 666, the so-called "number of the beast". Obviously in numbers like 27666, the three sixes are scarcely hidden but in a number like: $$ 998515 = 5 \times 7 \times 47 \times 607$$ the three sixes are not so obvious. It is only when add the 5, 7, 47 and 607 together that find the 666.

The 248 numbers (excluding numbers whose sum is a single digit) with this property are as follows (permalink) up to one million:

3305, 3966, 4613, 6590, 7908, 8489, 12293, 14366, 14789, 21998, 29093, 29486, 32489, 35813, 36568, 40133, 41139, 43289, 46373, 48868, 48975, 51353, 52240, 55193, 57989, 57998, 58770, 60713, 62688, 67288, 70524, 75699, 78244, 79913, 81989, 83333, 84206, 87173, 87448, 92933, 97432, 98379, 98789, 99653, 100889, 105113, 106468, 106755, 106793, 107753, 108389, 109289, 109611, 110213, 110489, 110633, 113726, 113872, 119198, 128106, 146392, 146644, 158515, 163455, 164691, 169886, 174352, 175539, 183998, 190218, 196146, 200846, 203032, 208975, 210926, 212248, 215246, 219566, 219998, 226450, 228411, 230488, 232683, 238779, 247555, 250770, 257368, 259299, 267488, 271740, 283672, 289539, 289856, 290788, 291655, 292312, 297066, 300924, 317848, 319131, 323500, 325348, 326088, 328851, 342808, 345499, 349986, 353650, 357579, 366849, 368548, 379455, 383128, 385659, 388200, 391588, 396628, 404752, 405844, 406552, 414080, 416650, 424380, 429028, 431019, 436725, 436888, 436948, 438244, 441098, 452672, 455346, 457371, 458968, 465840, 467571, 480963, 491499, 493570, 494488, 496896, 499980, 507955, 509256, 516339, 524070, 530115, 533312, 553539, 556299, 559008, 565456, 572575, 572913, 573208, 579352, 592284, 599976, 609546, 614872, 625155, 628884, 630140, 631768, 636138, 644859, 651771, 658975, 659395, 666832, 674008, 674973, 687090, 691731, 693592, 697255, 705100, 710739, 721048, 725650, 729688, 732896, 733912, 748371, 750186, 756168, 757912, 758259, 759615, 780291, 786328, 789592, 790770, 791274, 799015, 804952, 807832, 810256, 811179, 820899, 821272, 824508, 825651, 825979, 835288, 836706, 843352, 843488, 843855, 846120, 848728, 850689, 851992, 852651, 860248, 866968, 868312, 868888, 870780, 879452, 879655, 884559, 884619, 888291, 900112, 900200, 902528, 905571, 908811, 911538, 912543, 923931, 928832, 939699, 948771, 948924, 951885, 954819, 957243, 958491, 958818, 967779, 975339, 976851, 977499, 979179, 992563, 998515

Looking through this list we see that is only number that contains, overtly, the sequence 666. The number is: $$ 666832 = 2 \times 2 \times 2 \times  2 \times 71 \times 587 $$So this number is rather special in that it contains both on overt and covert 666 sequence. Of course, if we consider only distinct prime factors, ignoring multiplicity, we get a different list with only 192 members and with some numbers in common between the two lists. Permalink.

3305, 3966, 4613, 6590, 7932, 8489, 11898, 12293, 13180, 14366, 14789, 15864, 16525, 21998, 23796, 26360, 28732, 29093, 29486, 31728, 32291, 32489, 32950, 35694, 35813, 40133, 43289, 43996, 46373, 47592, 51353, 52720, 55193, 57464, 57989, 57998, 58972, 60713, 63456, 65900, 71388, 79913, 81989, 82625, 83333, 84206, 87173, 87992, 92933, 95184, 98789, 99653, 100889, 105113, 105440, 106755, 106793, 107082, 107753, 108389, 109289, 110213, 110357, 110489, 110633, 113726, 114928, 115996, 117944, 119198, 126912, 131800, 142776, 158026, 163455, 164750, 168412, 169886, 175539, 175984, 183998, 190368, 200846, 210880, 210926, 214164, 215246, 219566, 219998, 226037, 227452, 229856, 231992, 233567, 235888, 238396, 247555, 250770, 253824, 263600, 285552, 291655, 297066, 316052, 320265, 321246, 329500, 336824, 339772, 340147, 349986, 351968, 367996, 373966, 379455, 380736, 401692, 413125, 421760, 421852, 428328, 430492, 439132, 439996, 454904, 459712, 463984, 467571, 471776, 476792, 480963, 490365, 493570, 501540, 507648, 507955, 526617, 527200, 530115, 533775, 553539, 571104, 594132, 609546, 625155, 632104, 642492, 659000, 659395, 673648, 678178, 679544, 687090, 697255, 699972, 703936, 735992, 747932, 748371, 752310, 759615, 761472, 790770, 791274, 799015, 803384, 817275, 823750, 825979, 836706, 843520, 843704, 843855, 856656, 860984, 878264, 879655, 879992, 884559, 891198, 909808, 912543, 919424, 927968, 943552, 953584, 957243, 958818, 960795, 963738, 987140, 998515

Looking through the list, the first new number to appear is 11898 with the property that: $$ 11898 = 2 \times 3 \times 3 \times 661$$In this number, we ignore the second 3 and thus the sum is 2 + 3 + 661 = 666. 

Friday 4 August 2023

Biprime Prime Time

For some reason, it only just occurred to me that I can search this blog for the occurrence of particular numbers. Usually I search the OEIS first and if nothing of interest comes up, I search my Bespoken for Sequences database. If there's nothing there, I'll search the airtable.com database and if nothing turns up, I'll search for the number in the OEIS b-files. However, searching this blog should probably be my second priority if nothing comes up in the OEIS. After all I have hundreds of posts and thousands of numbers.


The theme of this post concerns biprimes or semiprimes where there is a connection between one prime and the other. The idea derived from the number associated with my diurnal age today: 27149. This number is a member of OEIS A045925:


 A045925

a(\(n\)) = \(n\) * Fibonacci(\(n\)).                                                            



When \(n=17\), we have Fibonacci(17) = 1597 which is prime and 27149 = 17 x 1597. Very few of the members of this sequence are biprimes because \(n\) can be composite and\or Fibonacci(\(n\)) can be composite. The biprimes are listed below (in bold):

3 --> 6 = 2 * 3
5 --> 25 = 5^2
7 --> 91 = 7 * 13
11 --> 979 = 11 * 89
13 --> 3029 = 13 * 233
17 --> 27149 = 17 * 1597
23 --> 659111 = 23 * 28657
29 --> 14912641 = 29 * 514229
43 --> 18640260791 = 43 * 433494437
47 --> 139647108431 = 47 * 2971215073


We are looking for biprimes of the form prime multiplied by some function of that prime where the function generates a new prime. An easy source of such numbers arises from OEIS A073065

 
 A073065



a(\(n\)) = prime(\(n\)) * prime(prime(\(n\))).



The sequence begins: 6, 15, 55, 119, 341, 533, 1003, 1273, 1909, 3161, 3937, 5809, 7339, 8213, 9917, 12773, 16343, 17263, 22177, 25063, 26791, 31679, 35773, 41029

The breakdown is as follows:

1 --> 2 x 3 = 6
2 --> 3 x 5 = 15
3 --> 5 x 11 = 55
4 --> 7 x 17 = 119
5 --> 11 x 31 = 341
6 --> 13 x 41 = 533
7 --> 17 x 59 = 1003
8 --> 19 x 67 = 1273
9 --> 23 x 83 = 1909
10 --> 29 x 109 = 3161
11 --> 31 x 127 = 3937
12 --> 37 x 157 = 5809
13 --> 41 x 179 = 7339
14 --> 43 x 191 = 8213
15 --> 47 x 211 = 9917
16 --> 53 x 241 = 12773
17 --> 59 x 277 = 16343
18 --> 61 x 283 = 17263
19 --> 67 x 331 = 22177
20--> 71 x 353 = 25063
21 --> 73 x 367 = 26791
22 --> 79 x 401 = 31679
23 --> 83 x 431 = 35773
24 --> 89 x 461 = 41029
25 --> 97 x 509 = 49373


Another way to find "special" biprimes is to determine which of them concatenate to form new primes, either by smaller with larger or larger with smaller. Such biprimes form OEIS A330441:


 A330441

Semiprimes \(p \times q\) such that the concatenations of \(p\) and \(q\) in both orders are prime.                     



Here is a list of the initial members (508) of this sequence up to 40000:

21, 33, 51, 93, 111, 133, 177, 201, 219, 247, 253, 327, 411, 427, 573, 589, 679, 687, 763, 793, 813, 889, 993, 1077, 1081, 1119, 1243, 1339, 1347, 1401, 1411, 1497, 1501, 1603, 1623, 1651, 1671, 1821, 1839, 1843, 1851, 1981, 2019, 2047, 2059, 2103, 2157, 2199, 2217, 2469, 2479, 2629, 2761, 2787, 2841, 2923, 3031, 3039, 3057, 3097, 3099, 3133, 3153, 3409, 3439, 3543, 3579, 3661, 3711, 3787, 3829, 3883, 3973, 4063, 4171, 4303, 4309, 4369, 4381, 4429, 4443, 4593, 4681, 4711, 4771, 4821, 4837, 4843, 4881, 4971, 4989, 5001, 5097, 5191, 5299, 5533, 5611, 5721, 5761, 5803, 5971, 5989, 6181, 6207, 6429, 6457, 6511, 6559, 6613, 6639, 6799, 6891, 7003, 7131, 7143, 7153, 7233, 7323, 7327, 7363, 7501, 7509, 7633, 7711, 7737, 8121, 8173, 8197, 8227, 8347, 8367, 8529, 8659, 8743, 8751, 8871, 9147, 9211, 9217, 9229, 9307, 9313, 9357, 9493, 9523, 9589, 9793, 9853, 9903, 10063, 10171, 10249, 10297, 10351, 10383, 10407, 10441, 10483, 10519, 10537, 10777, 10807, 10843, 10849, 10911, 10963, 11107, 11307, 11539, 11581, 11623, 11629, 11653, 11707, 11733, 11769, 11793, 11797, 11851, 12001, 12057, 12133, 12187, 12193, 12477, 12643, 12759, 12961, 13027, 13117, 13153, 13387, 13471, 13749, 13771, 13813, 13951, 13993, 14187, 14257, 14623, 14677, 14757, 14803, 14977, 15049, 15127, 15151, 15153, 15177, 15229, 15247, 15297, 15513, 15571, 15697, 15769, 15843, 15883, 15969, 16003, 16009, 16143, 16257, 16347, 16357, 16387, 16501, 16507, 16521, 16543, 16563, 16593, 16719, 16837, 17089, 17131, 17173, 17269, 17371, 17403, 17503, 17517, 17521, 17607, 17769, 17779, 17803, 17833, 17953, 18111, 18219, 18247, 18319, 18673, 18697, 18709, 18789, 18829, 18831, 18841, 18871, 18943, 18949, 19021, 19033, 19039, 19059, 19353, 19357, 19407, 19587, 19627, 19689, 19693, 19713, 19741, 19797, 19807, 19897, 19911, 19939, 19959, 20059, 20191, 20221, 20317, 20379, 20581, 20613, 20671, 20697, 20701, 20841, 21117, 21133, 21151, 21171, 21253, 21439, 21457, 21477, 21691, 21703, 21759, 22069, 22107, 22207, 22267, 22459, 22507, 22759, 22773, 22947, 23073, 23317, 23377, 23503, 23527, 23713, 23731, 23889, 24031, 24193, 24313, 24343, 24487, 24607, 24613, 24643, 24657, 24711, 24721, 24949, 25081, 25131, 25267, 25291, 25293, 25507, 25549, 25651, 25729, 25777, 25813, 25887, 25963, 26007, 26077, 26089, 26097, 26139, 26167, 26241, 26329, 26349, 26359, 26401, 26629, 26761, 26989, 27049, 27309, 27469, 27471, 27493, 27543, 27619, 27723, 27781, 28117, 28129, 28189, 28383, 28417, 28563, 28831, 28869, 28993, 29113, 29227, 29239, 29407, 29479, 29533, 29571, 29647, 29661, 29703, 29707, 29713, 29731, 30273, 30333, 30499, 30507, 30511, 30607, 30669, 30721, 30729, 30799, 30979, 30999, 31071, 31087, 31273, 31279, 31363, 31377, 31453, 31459, 31483, 31549, 31621, 31701, 31711, 31881, 31969, 32167, 32197, 32281, 32313, 32667, 32743, 32961, 33043, 33081, 33103, 33519, 33531, 33591, 33913, 34063, 34117, 34179, 34321, 34339, 34341, 34417, 34459, 34609, 34653, 34789, 34813, 34933, 34957, 35173, 35299, 35359, 35383, 35463, 35481, 35601, 35691, 35743, 35779, 35943, 35953, 36019, 36181, 36213, 36259, 36303, 36367, 36601, 36609, 36649, 36667, 36759, 36763, 36769, 36807, 36961, 37029, 37063, 37099, 37239, 37267, 37351, 37353, 37399, 37621, 37803, 38059, 38109, 38131, 38137, 38347, 38359, 38389, 38523, 38623, 38647, 38683, 38697, 38929, 38937, 39007, 39049, 39427, 39487, 39553, 39613, 39649, 39823, 39931, 39967

 For example, 27309= 3 * 9103 and the concatenations 39103 and 91033 are both prime.