Friday, 28 August 2026

Inserting Digits

28269 is a composite number with the interesting property that if we insert the digit 7 in any position, the result is a prime number. Thus 728269, 278269, 287269, 282769, 282679 and 282697 are all prime. Such numbers belong to OEIS A216168 (permalink):


A216168: composite numbers and 1 which yield a prime whenever a 7 is inserted anywhere in them, including at the beginning or end.

Up to 40000, the members of the sequence are:

1, 9, 27, 33, 39, 57, 87, 159, 177, 187, 603, 717, 753, 949, 1257, 1707, 2277, 2367, 4317, 4623, 4779, 4797, 5773, 6757, 6777, 7017, 7471, 7479, 7747, 7797, 7813, 7977, 8797, 9777, 9987, 10777, 11757, 17679, 28269, 28437, 29779, 34177, 34771

There is an associated OEIS sequence for inserting the digit 1. It is OEIS A216165 (permalink):


A216165: composite numbers and 1 which yield a prime whenever a 1 is inserted anywhere in them, including at the beginning or end.

The initial members of this sequence are:

1, 49, 63, 81, 91, 99, 117, 123, 213, 231, 279, 319, 427, 459, 621, 697, 721, 801, 951, 987, 1113, 1131, 1261, 1821, 1939, 2101, 2149, 2211, 2517, 2611, 3151, 3219, 4011, 4411, 4887, 5031, 5361, 6231, 6487, 7011, 7209, 8671, 9141, 9801, 10051, 10161, 10281, 10603, 10921, 11121, 11127, 11211, 11641, 11767, 11791, 11869, 12997, 13111, 13143, 14311, 16911, 17023, 17541, 18081, 18619, 19677, 21039, 21711, 23289, 25197, 29169, 29971, 31111, 34777, 38559

Here is the associated OEIS A216166 sequence for inserting a 3 (permalink).


A216166: composite numbers and 1 which yield a prime whenever a 3 is inserted anywhere in them (including at the beginning or end).

The initial members of this sequence are:

1, 121, 343, 361, 533, 637, 793, 889, 943, 1183, 3013, 3223, 3353, 3403, 3757, 3827, 3893, 4313, 4543, 4963, 8653, 10423, 14257, 20339, 23083, 23419, 30917, 33031, 33101, 33323, 33433, 33701, 33821, 34333, 34393, 35453, 36437, 36533, 39137, 39247

Here is the result for inserting the digit 9. I wasn't able to locate the OEIS sequence (permalink).

91, 209, 539, 749, 923, 931, 1079, 1139, 2717, 2959, 3971, 3979, 4559, 5629, 6401, 6739, 8213, 8491, 8939, 9607, 11089, 11227, 13943, 14269, 14371, 17381, 17689, 24059, 25517, 25937, 25949, 29087, 29197, 29419, 30989, 31691

There are various variations on this theme. Once can look at numbers, both composite and prime, or one can look at only primes. The insertion can be between digits but not at the beginning and end. The insertion can be only at the beginning and end etc. Let's consider one of these: OEIS A216167.


A216167: composite numbers which yield a prime whenever a 5 is inserted anywhere in them, excluding at the end.


Here are the initial members of the sequence:

9, 21, 57, 63, 69, 77, 87, 93, 153, 231, 381, 407, 413, 417, 501, 531, 581, 651, 669, 741, 749, 783, 791, 987, 1241, 1551, 1797, 1971, 2189, 2981, 3381, 3419, 3591, 3951, 4083, 4503, 4833, 4949, 4959, 5049, 5117, 5201, 5229, 5243, 5529, 5547, 5603, 5691, 5697, 50 6957, 7329, 7389, 7557, 8451, 8711, 9561, 9617, 11337, 11631, 13511, 13533, 15153, 17991, 19539, 23553, 25869, 27053, 30093, 31551, 32249, 32951, 36441, 38159

This approach could be extended to biprimes. For example, one could ask what biprimes (or semiprimes) remain biprimes when the digit 1 is inserted anywhere in the number, including its beginning and end? Using Gemini, here are results that were generated:

Biprimes up to 40000 maintaining the property upon digit insertion (permalink):

Digit 0:

None found in this range.

Digit 1:

[34, 55, 77, 85, 87, 111, 119, 121, 141, 219, 415, 417, 514, 537, 591, 689, 713, 717, 718, 731, 781, 835, 841, 921, 1111, 1114, 1138, 1227, 1293, 1357, 1391, 1591, 1643, 1671, 1761, 1851, 1915, 2171, 2181, 2533, 2623, 2631, 3207, 3561, 3579, 3811, 4119, 4171, 4267, 4353, 5223, 5311, 5321, 5353, 6157, 6181, 6429, 6621, 6697, 7087, 7113, 7131, 7251, 7311, 7513, 7531, 7571, 7897, 8201, 8254, 8511, 8659, 9111, 9123, 9167, 9247, 9271, 9487, 9651, 10147, 10217, 10401, 10417, 10699, 10743, 10765, 11013, 11101, 11107, 11391, 11479, 11513, 11787, 11819, 11899, 12219, 12381, 12399, 12709, 12718, 12751, 12773, 14109, 14119, 14527, 14711, 14727, 15261, 15711, 16213, 16251, 16489, 16621, 16751, 16801, 16917, 17151, 17461, 17527, 17601, 17677, 18091, 18519, 18591, 19111, 19117, 19711, 19729, 19741, 19858, 19959, 20311, 21103, 21461, 21829, 22601, 23811, 24159, 24161, 25331, 26283, 26521, 26869, 27087, 27831, 28009, 29487, 30061, 30157, 30499, 31273, 31587, 32521, 32599, 33193, 33953, 34051, 34567, 34663, 35941, 36331, 36631, 37081, 37461, 37891, 38067, 38623, 39478, 39793]

Digit 2:

[6, 26, 62, 206, 302, 1202, 1226, 1262, 2966, 12242, 26762, 32282, 36422]

Digit 3:

[9, 14, 39, 55, 58, 93, 94, 133, 235, 274, 291, 305, 309, 314, 365, 403, 453, 554, 649, 713, 763, 1067, 1133, 1157, 1385, 1589, 1631, 1961, 1969, 2073, 2174, 2231, 2419, 2483, 2723, 2811, 2867, 3035, 3043, 3134, 3239, 3351, 3443, 3455, 3518, 3595, 3974, 3991, 4315, 4387, 4478, 5057, 5249, 5545, 5761, 6071, 6233, 6431, 6731, 6807, 6817, 6893, 6953, 7033, 7067, 7403, 7543, 7903, 8141, 8359, 8438, 8473, 8483, 8495, 8683, 9395, 9713, 9731, 9838, 9943, 10609, 10897, 11107, 11179, 13483, 13531, 13953, 14131, 14473, 14515, 14809, 15163, 15397, 15833, 16049, 16331, 17113, 17281, 17311, 17521, 17767, 18613, 18721, 19331, 19651, 19693, 20191, 20831, 21541, 22121, 22163, 22733, 23107, 23237, 23303, 23503, 23533, 24173, 24283, 24797, 25129, 25843, 26173, 26545, 27389, 27833, 28399, 29903, 30353, 30445, 30779, 30973, 31187, 31309, 31463, 31757, 31861, 32023, 32231, 32293, 32483, 32539, 32723, 32861, 33017, 33134, 33163, 33193, 33238, 33307, 33313, 33314, 33373, 33407, 33443, 33643, 33689, 33833, 33881, 33951, 33953, 33977, 33979, 34003, 34201, 34249, 34633, 34837, 34885, 35063, 35303, 35723, 35887, 36283, 36289, 36893, 37033, 37333, 37351, 37391, 37733, 38057, 38939, 39449, 39497, 39513, 39793]

Digit 4:

[9, 69, 93, 115, 319, 321, 381, 427, 471, 489, 511, 529, 535, 559, 1101, 1383, 1441, 1623, 1909, 2173, 2319, 2361, 2761, 2881, 3409, 3817, 4009, 4141, 4413, 4479, 4749, 5029, 5143, 5299, 5455, 5611, 6249, 6313, 6331, 6423, 6459, 6541, 7063, 7423, 8097, 8403, 8797, 9313, 11029, 11787, 11881, 12063, 13051, 13389, 13449, 13641, 14187, 14473, 14493, 15529, 18247, 21427, 23611, 24643, 25351, 26409, 26457, 26989, 27157, 28761, 30531, 31609, 31987, 34627, 35493, 35713, 36019]

Digit 5:

[15, 35, 51, 65, 155, 219, 299, 411, 515, 545, 554, 713, 755, 771, 818, 893, 905, 965, 993, 1055, 1469, 2651, 3005, 3065, 3953, 4313, 4359, 4811, 5033, 5069, 5123, 5129, 5345, 5429, 5513, 5543, 5585, 5891, 6218, 7053, 8051, 8301, 8553, 8945, 9155, 9543, 10109, 10749, 16535, 16595, 16955, 17529, 17555, 18653, 19451, 21449, 23255, 24263, 25061, 25131, 25293, 25751, 27831, 28529, 30993, 31539, 33551, 33933, 34559, 35411, 35681, 35693, 35921]

Digit 6:

[22, 62, 122, 662, 746, 2066, 17522, 38062]

Digit 7:

[377, 471, 721, 737, 778, 799, 849, 961, 1057, 1267, 1273, 1639, 1651, 1717, 2041, 2257, 2458, 2841, 3099, 3763, 3977, 3981, 4083, 4247, 4281, 4467, 4577, 4757, 5497, 6009, 6087, 6127, 6267, 6297, 6341, 6729, 6787, 7117, 7313, 7739, 7921, 7971, 8063, 8097, 8457, 8749, 8907, 9057, 9313, 9469, 9897, 9899, 10381, 10617, 11013, 11107, 11217, 11283, 12273, 13017, 13749, 14277, 14757, 15529, 16147, 16957, 17071, 17179, 17439, 17503, 17517, 17637, 17701, 17773, 17781, 17809, 18283, 19039, 19857, 21477, 21741, 23731, 24537, 27147, 27433, 27769, 28263, 28999, 29163, 29229, 30007, 30127, 30721, 31753, 31879, 32259, 32937, 33163, 33897, 34467, 35881, 37381, 37803, 37837]

Digit 8:

[15, 69, 95, 119, 213, 341, 843, 1337, 2481, 2831, 3057, 3161, 3489, 3513, 3587, 3849, 4803, 5489, 5663, 6189, 6459, 6893, 7113, 7355, 7379, 7409, 8057, 8141, 8187, 8189, 8279, 8331, 8399, 8567, 8751, 8889, 8981, 9881, 10119, 11009, 11381, 11477, 12171, 12531, 14109, 16721, 17517, 18087, 18227, 18663, 18809, 20669, 20783, 22467, 23597, 26081, 28299, 28511, 28739, 28781, 28887, 29321, 29891, 30209, 32393, 33881, 34409, 36321, 37581, 38217]

Digit 9:

[4, 21, 33, 51, 74, 93, 95, 115, 119, 183, 235, 247, 259, 481, 589, 799, 813, 914, 917, 959, 979, 989, 993, 995, 998, 1067, 1101, 1165, 1174, 1589, 1799, 1829, 1849, 2098, 2249, 2257, 2509, 2654, 2839, 2923, 2977, 3029, 3099, 3421, 3781, 3959, 4097, 4319, 4699, 4859, 4897, 5065, 5137, 5293, 5909, 5993, 6049, 6107, 6898, 7837, 7921, 8314, 8359, 8489, 8593, 8921, 9094, 9299, 9329, 9335, 9353, 9509, 9569, 9599, 9691, 9763, 9865, 9959, 9977, 10189, 10489, 10511, 10999, 12139, 12199, 13989, 14311, 14599, 14761, 15011, 15409, 15449, 15829, 16013, 16357, 16969, 17131, 17149, 17177, 17663, 18293, 18383, 18991, 19099, 19187, 19307, 19369, 19493, 19579, 19658, 19667, 19879, 19907, 19959, 20093, 20131, 20765, 21469, 22387, 22597, 22927, 22991, 23299, 24839, 24901, 25003, 25401, 25807, 25927, 26291, 26447, 27667, 27723, 27859, 27877, 28877, 28939, 28981, 28997, 29227, 29321, 29878, 30679, 30767, 30799, 30997, 31909, 32961, 34309, 35215, 35269, 35833, 35939, 36289, 36989, 37249, 38093, 38159, 38641, 39289, 39797]

Let's test for 28299 which is listed under the digit 8 where we find that:
  • \(28299 = 3 \times 9433\)
  • \(828299 = 23 \times 36013\)
  • \(288299 = 11 \times 26209\)
  • \(282899 = 79 \times 3581\)
  • \(282989 = 7 \times 40427\)
  • \(282998 = 2 \times 141499\)
Here the results for sphenic numbers (permalink):

Digit 0:

None found in this range.

Digit 1:

[1595, 3245, 5258, 5710, 7015, 7718, 8255, 8395, 9185, 9878, 9915, 11018, 11194, 16511, 17005, 18518, 18758, 18778, 19245, 27911, 30354, 31665, 33115, 33514, 37614, 38129, 39179]

Digit 2:

[222, 282, 1742, 2222, 2586, 2782, 2922, 3286, 3342, 3926, 4342, 4362, 4722, 5066, 5246, 5262, 7582, 7622, 7782, 8706, 9726, 10622, 10642, 11822, 13782, 14126, 15026, 15422, 16402, 16682, 17122, 20802, 21566, 21962, 22026, 22202, 22782, 23026, 25782, 26942, 27122, 27282, 27726, 29926, 30522, 31002, 31922, 32426, 33242, 34302, 34922, 36182, 37022, 38222, 39422, 39482]

Digit 3:

[615, 1245, 1533, 2198, 2289, 2739, 3333, 3355, 3358, 3590, 5034, 5558, 5734, 6730, 7761, 8238, 8931, 9254, 12189, 12207, 12215, 12595, 13334, 15035, 15897, 15933, 16833, 17733, 18381, 18578, 18579, 18867, 20194, 20894, 23834, 24447, 25534, 28634, 28821, 30385, 30747, 30981, 31190, 32349, 32354, 32774, 33303, 33321, 33835, 33843, 33998, 35734, 37205, 37505, 37558, 38001, 38165, 38973, 39058, 39819, 39934]

Digit 4:

[345, 665, 1547, 1955, 2895, 4585, 4695, 5595, 6645, 7545, 7885, 8729, 9465, 9485, 9515, 9685, 9911, 9915, 10885, 12265, 14465, 19245, 19495, 22555, 25991, 26381, 26745, 29087, 32035, 32145, 32155, 35405]

Digit 5:

[385, 555, 595, 705, 1085, 1455, 2085, 2355, 2555, 2685, 2865, 3355, 3558, 3565, 3585, 4345, 4355, 4565, 4605, 5258, 5405, 5495, 5555, 5835, 5898, 6135, 6785, 6955, 6978, 7554, 7955, 8355, 8533, 9678, 10585, 11473, 12174, 12395, 13115, 13574, 14795, 15535, 17515, 17895, 19598, 20855, 20881, 21765, 21954, 23165, 25085, 25334, 25543, 25858, 26114, 26115, 26555, 26765, 28145, 28754, 29235, 30594, 30635, 30965, 32415, 33155, 33485, 34655, 35315, 35655, 35893, 36515, 36555, 37465, 37565, 37655, 38185, 38558, 39589, 39785, 39885, 39895]

Digit 6:

[186, 266, 582, 806, 906, 1266, 2266, 3562, 3606, 4462, 4966, 5486, 5622, 6086, 6386, 6886, 7966, 9266, 10366, 10586, 13166, 14162, 14806, 16702, 17366, 21626, 22526, 23246, 23446, 26966, 27062, 28262, 31666, 32662, 34226, 34622, 37226, 39742]

Digit 7:

[777, 4330, 4697, 4938, 5678, 5757, 7287, 7777, 7798, 8378, 8898, 9258, 17798, 19877, 23009, 25277, 29530, 29798, 30797, 32514, 36707, 36743, 37077]

Digit 8:

[2185, 2795, 2821, 6335, 8195, 8215, 8255, 8355, 8905, 9285, 10165, 11615, 14885, 18241, 18885, 26315, 30965, 31027, 34177]

Digit 9:

[399, 915, 1515, 2595, 2877, 2937, 2955, 2985, 3201, 3399, 3598, 3945, 4767, 5019, 5133, 5709, 6141, 6693, 7257, 7918, 8697, 8798, 9291, 9398, 9545, 9717, 10090, 10923, 14755, 15171, 15794, 18699, 19495, 19833, 19839, 19869, 19970, 20694, 21754, 21957, 22258, 22989, 23691, 24477, 25203, 25809, 27219, 29289, 29578, 30018, 32165, 34869, 35457, 36879, 39158, 39185]

Let's test for 28262 which is listed under the digit 6:
  • \(28262 = 2 \times 13 \times 1087 \)
  • \(628262 = 2 \times 53 \times 5927 \)
  • \(268262 = 2 \times 113 \times 1187 \)
  • \(286262 = 2 \times 41 \times3491 \)
  • \(282662 = 2 \times 79 \times 1789 \)
  • \(282626 = 2 \times251 \times 563 \)

No comments:

Post a Comment