Friday, 20 March 2026

Concatenating Emirpimes

Emirpimes have the property that they remain semiprimes when reversed. Thus 15 = 3 x 5 becomes 51 when the digits are reversed and 51 = 3 x 17 which is also a semiprime. What happens to the emirpimes if it is concatenated with its reverse. Does it remain a semiprime? In the case 15, this leads to 1551 = 3 x 11 x 47 which is a sphenic number and not a semiprime. The first such emirpimes is 94 because 9449 = 11 x 859 is a semiprime. In fact all such emirpimes will have 11 as a factor. Here is Gemini's explanation:

The reason no numbers starting with the digit 2 appear in your output comes down to two absolute mathematical rules regarding divisibility: the behavior of even-length palindromes and the properties of even numbers.

When you concatenate a number that begins with 2 with its exact reverse, you are guaranteeing that the resulting number will have at least three prime factors, which automatically disqualifies it from being a semiprime.

Here is the step-by-step breakdown of exactly why this happens:

1. The Concatenated Number is Always an Even-Length Palindrome

When you take any number string and append its exact reverse (e.g., $n = 26$, $rev = 62$, resulting in 2662), you create a perfect mirror image. Because you are doubling the number of digits, the resulting palindrome will always have an even length.

There is a fundamental rule in number theory: Every palindrome with an even number of digits is divisible by 11. Because your program only evaluates these concatenated mirror-images, every single number evaluated in that final step has 11 as one of its prime factors.

2. The Resulting Number Always Ends in 2

If your original number ($n$) starts with the digit 2, its reverse will naturally end with the digit 2. When you concatenate the original number with its reverse, the very last digit of the new string will be the last digit of the reverse.

For example:

  • Original: 215

  • Reverse: 512

  • Concatenation: 215512

Because the concatenated number ends in 2, it is an even number. This means 2 is definitively another prime factor of the concatenated number.

3. The Factor Count Exceeds the Semiprime Limit

By definition, a semiprime must have exactly two prime factors (e.g., $p_1 \times p_2$).

If you start with a number beginning with 2, we have already established that the final concatenated number is divisible by both 11 and 2. Therefore, the number is a multiple of 22.

For a multiple of 22 to be a semiprime, the number would have to be exactly 22 itself (where 2 and 11 are the only factors). For your program to generate 22, the original number would have to be 2, and the reverse would have to be 2. This fails on multiple fronts:

  • 2 is a prime number, not a semiprime.

  • Your code explicitly filters out palindromes (n != rev_n), so it would ignore 2 anyway.

Any valid concatenated number your program produces that begins with a 2 will be much larger than 22 (the smallest would be 2442, derived from $n=24$). Therefore, its prime factorization will always look like $2 \times 11 \times x$, containing at least three prime factors.

Broader Implications

Because of these exact same mathematical rules, your output will also never contain numbers starting with:

  • 4, 6, or 8: The resulting concatenations would all end in an even number, meaning they are divisible by 2 and 11, resulting in too many factors.

  • 5: The resulting concatenation would end in a 5, meaning it is divisible by 5 and 11, again resulting in too many factors.

The only numbers that can mathematically survive this final semiprime check are those starting with 1, 3, 7, or 9.

Here is the list of emirpimes that satisfy in the range up to 40,000 (permalink):

=== Emirpime Concatenation Statistics ===

Range evaluated: 1 to 40000

1. Semiprimes: 9790 (24.47% of the range)

2. Emirpimes: 3450 (8.62% of the range)

3. Successful Emirpimes: 476 (1.1900% of the range)

94, 115, 169, 185, 341, 355, 394, 398, 766, 794, 923, 926, 955, 985, 1027, 1046, 1141, 1174, 1195, 1202, 1238, 1247, 1306, 1343, 1366, 1382, 1417, 1418, 1466, 1642, 1658, 1703, 1714, 1754, 1757, 1769, 1843, 1891, 1915, 1927, 1985, 3047, 3062, 3071, 3091, 3097, 3098, 3103, 3151, 3166, 3227, 3317, 3385, 3403, 3473, 3599, 3635, 3646, 3653, 3785, 3817, 3866, 3949, 3959, 3979, 3983, 7051, 7058, 7082, 7094, 7165, 7169, 7183, 7186, 7223, 7226, 7235, 7274, 7291, 7318, 7346, 7354, 7367, 7403, 7522, 7637, 7655, 7663, 7715, 7754, 7795, 7849, 7855, 7981, 9121, 9242, 9259, 9346, 9427, 9569, 9578, 9593, 9599, 9617, 9727, 9755, 9809, 9946, 9953, 9983, 9997, 10033, 10085, 10129, 10195, 10261, 10342, 10345, 10462, 10466, 10483, 10517, 10541, 10546, 10558, 10637, 10673, 10705, 10805, 11006, 11141, 11147, 11249, 11302, 11306, 11363, 11366, 11539, 11563, 11591, 11641, 11651, 11653, 11654, 11714, 11723, 11851, 11893, 11917, 11945, 12001, 12013, 12067, 12127, 12146, 12199, 12202, 12217, 12283, 12317, 12361, 12367, 12439, 12458, 12494, 12509, 12674, 12718, 12751, 12758, 12761, 12851, 12877, 12913, 12937, 13102, 13106, 13133, 13142, 13193, 13273, 13322, 13373, 13391, 13459, 13529, 13637, 13739, 13742, 13787, 13817, 13934, 13993, 14015, 14111, 14171, 14213, 14219, 14242, 14261, 14273, 14291, 14318, 14359, 14486, 14501, 14611, 14642, 14647, 14765, 14786, 14834, 14999, 15094, 15157, 15335, 15362, 15389, 15403, 15623, 15658, 15779, 15781, 15793, 15815, 15863, 15874, 15893, 15989, 16003, 16123, 16129, 16153, 16207, 16265, 16331, 16334, 16367, 16387, 16489, 16507, 16859, 16865, 16909, 16969, 17083, 17218, 17261, 17305, 17311, 17441, 17503, 17533, 17611, 17614, 17662, 17687, 18035, 18155, 18463, 18482, 18547, 18613, 18623, 18686, 18689, 18695, 18794, 18806, 18847, 18937, 19015, 19165, 19217, 19246, 19286, 19297, 19331, 19337, 19354, 19358, 19405, 19445, 19579, 19585, 19607, 19637, 19667, 19757, 19858, 19882, 19931, 19969, 30043, 30143, 30182, 30407, 30413, 30437, 30574, 30605, 30607, 30641, 30662, 30731, 30754, 30755, 30779, 30826, 30854, 30865, 30886, 30913, 30991, 30994, 30995, 31127, 31138, 31282, 31342, 31399, 31453, 31807, 31843, 31853, 31946, 31969, 32066, 32071, 32137, 32138, 32177, 32366, 32455, 32458, 32501, 32593, 32602, 32663, 32666, 32765, 32842, 32845, 32891, 33109, 33253, 33257, 33445, 33458, 33559, 33593, 33737, 33991, 34073, 34154, 34169, 34186, 34187, 34205, 34379, 34382, 34409, 34477, 34571, 34598, 34657, 34723, 34745, 34802, 34831, 34907, 34999, 35078, 35135, 35137, 35147, 35173, 35215, 35263, 35269, 35285, 35471, 35522, 35545, 35567, 35723, 35773, 35779, 35813, 35881, 36029, 36035, 36065, 36139, 36143, 36203, 36227, 36311, 36422, 36427, 36446, 36481, 36503, 36535, 36614, 36626, 36631, 36649, 36679, 36733, 36734, 36745, 36794, 36802, 37006, 37031, 37034, 37099, 37153, 37157, 37231, 37331, 37358, 37399, 37438, 37457, 37477, 37487, 37498, 37514, 37574, 37601, 37739, 37834, 37837, 37931, 37946, 37958, 38174, 38209, 38245, 38401, 38413, 38414, 38477, 38497, 38534, 38585, 38597, 38635, 38719, 38785, 38806, 38951, 39037, 39127, 39142, 39205, 39253, 39265, 39289, 39449, 39518, 39523, 39653, 39797, 39826, 39871, 39898, 39899, 39911, 39931, 39947, 39958, 39959, 39977

No comments:

Post a Comment