Thursday, 23 February 2023

Concatenating Prime Factors

I noticed that the number associated with my diurnal age today, 26989, is a semiprime that factors to 137 x 197. Concatenating these two factors, we get 137197 which is prime but if we concatenate 197 x 137 we get 197137 which is also prime. Semiprimes with this property constitute OEIS A330441:


 A330441

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



The initial members of this sequence are:

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

Given that 26989 is an emirpimes (since its reverse is a distinct semiprime: 98962 = 2 x 49481), I thought I'd investigate how many emirpimes are in this sequence. It turns out that in the range up to one million there are the following:

3099, 9903, 10519, 11707, 13993, 16387, 18247, 19039, 30607, 32667, 36367, 38697, 39487, 39931, 70603, 70711, 72247, 73099, 74227, 74281, 74289, 76029, 76363, 76623, 78361, 78493, 78619, 79683, 91501, 91687, 92067, 93091, 98247, 99037, 100437, 101317, 101899, 104529, 108181, 108789, 120553, 126771, 133243, 134797, 137671, 144523, 147061, 149449, 159427, 160741, 168117, 176731, 176767, 177621, 181801, 184033, 197097, 199879, 312817, 322489, 325441, 328459, 330397, 330481, 331783, 337297, 337897, 338977, 342331, 345493, 350569, 355021, 357393, 365863, 368563, 386197, 387133, 393753, 394543, 711861, 713101, 716779, 717469, 718213, 724951, 734001, 767671, 779833, 790791, 791683, 792733, 793033, 797431, 798733, 925401, 944941, 951679, 954823, 964699, 964717, 965053, 976159, 977617, 978991, 984223, 987801, 996469, 998101

Let's check one of the entries, say the last. 998101 should have its reversal present in the list, 101899, which it does and both should have factors that can be concatenated in either way to produce primes:

998101 = 13 x 76777 with 1376777 and 7677713 both prime
101899 =  7 x 14557 with 714557 and 145577 both prime

This got me thinking about sphenic numbers, that is numbers of the form \(p \times q \times r\) where \(p\), \(q\) and \(r\) are distinct prime factors, with the property that any concatenation of these prime factors produces a prime. In other words:
  • p | q | r is prime
  • p | r | q is prime
  • q | p | r is prime
  • q | r | p is prime
  • r | p | q is prime
  • r | q | p is prime
In the range up to one million, there are 15 such numbers (permalink). They are:

3311, 27181, 32153, 41237, 53977, 86507, 110971, 125069, 208579, 256413, 500981, 543337, 853811, 901949, 964481

Here is the breakdown for each number:

3311 = 7 x 11 x 43 --> 71143 74311 11743 11437 43117 43711
27181 = 7 x 11 x 353 --> 711353 735311 117353 113537 353117 353711
32153 = 11 x 37 x 79 --> 113779 117937 371179 377911 793711 791137
41237 = 7 x 43 x 137 --> 743137 713743 437137 431377 137437 137743
53977 = 7 x 11 x 701 --> 711701 770111 117701 117017 701117 701711
86507 = 19 x 29 x 157 --> 1929157 1915729 2919157 2915719 1572919 1571929
110971 = 7 x 83 x 191 --> 783191 719183 837191 831917 191837 191783
125069 = 7 x 17 x 1051 --> 7171051 7105117 1771051 1710517 1051177 1051717
208579 = 7 x 83 x 359 --> 783359 735983 837359 833597 359837 359783
256413 = 3 x 127 x 673 --> 3127673 3673127 1273673 1276733 6731273 6733127
500981 = 13 x 89 x 433 --> 1389433 1343389 8913433 8943313 4338913 4331389
543337 = 17 x 31 x 1031 --> 17311031 17103131 31171031 31103117 10313117 10311731
853811 = 7 x 283 x 431 --> 7283431 7431283 2837431 2834317 4312837 4317283
901949 = 19 x 37 x 1283 --> 19371283 19128337 37191283 37128319 12833719 12831937
964481 = 7 x 211 x 653 --> 7211653 7653211 2117653 2116537 6532117 6537211

Note how 9 of the 15 numbers have 7 as a factor. Even though the reversals of some of the above numbers are also sphenic numbers (35123, 179011, 975802, 189005, 949109), none of them have the concatenating prime factors property. The first member of any sequence is special and so the takeaway here might be the following:
3099 is the smallest of a very special class of semiprimes because its distinct prime factors can be concatenated in either order to make primes and its reversal, 9903, is also a semiprime with the same property.

3311 is the smallest of a very special class of sphenic numbers because its prime factors can be concatenated in all six ways to make primes. 

While this topic falls squarely into the category of recreational mathematics, it's nonetheless fun to investigate and it helps to challenge my limited SageMath programming capabilities.

No comments:

Post a Comment