Showing posts with label subtraction. Show all posts
Showing posts with label subtraction. Show all posts

Friday, 11 September 2026

Variations on Magnanimous Numbers

Today I'm 28285 days old and one of the properties of this number is that it's magnanimous, meaning that inserting a "+" between any two digits produces a prime. In this case we have:

  • 2+8285 = 8287 is prime

  • 28+285 = 313 is prime

  • 282+85 = 367 is prime

  • 2828+5 = 2833 is prime
I review these sorts of numbers in my post titled Magnanimous Numbers from December of 2020. This got me thinking about subtraction instead of addition or to put it formally and applying the absolute value operator:

| Minuend - Subtrahend | = | Difference |

Take as an example, the number 28041 where we have:
  • | 2 - 8041 | = 8039 is prime

  • | 28 - 41 | = 13 is prime

  • | 280 - 41 | = 239 is prime

  • | 2804 - 1 | = 2803 is prime
Here is the full list of 230 such numbers up to 40000 (permalink):

13, 14, 16, 18, 20, 24, 25, 27, 29, 30, 31, 35, 36, 38, 41, 42, 46, 47, 49, 50, 52, 53, 57, 58, 61, 63, 64, 68, 69, 70, 72, 74, 75, 79, 81, 83, 85, 86, 92, 94, 96, 97, 103, 108, 114, 118, 130, 132, 138, 154, 174, 190, 198, 207, 209, 225, 245, 263, 269, 285, 301, 310, 332, 334, 356, 370, 376, 392, 409, 421, 441, 447, 463, 465, 487, 503, 507, 518, 536, 552, 558, 601, 623, 629, 643, 665, 667, 689, 709, 710, 714, 730, 736, 754, 774, 790, 796, 801, 845, 867, 907, 912, 956, 970, 992, 1003, 1114, 1152, 1158, 1332, 1354, 1510, 1614, 1758, 1930, 1992, 1998, 2007, 2009, 2025, 2241, 2421, 2465, 2603, 2609, 2663, 2685, 2729, 2825, 2841, 2865, 3154, 3310, 3370, 3376, 3392, 3436, 3512, 3596, 3634, 3730, 3790, 3956, 3970, 4021, 4047, 4087, 4201, 4245, 4341, 4401, 4467, 4603, 4663, 4665, 4687, 4801, 4867, 5052, 5156, 5514, 5592, 5658, 5952, 5996, 6001, 6023, 6029, 6043, 6065, 6067, 6089, 6163, 6203, 6245, 6269, 6365, 6563, 6607, 6623, 6689, 6863, 7009, 7134, 7270, 7314, 7390, 7396, 7570, 7734, 7936, 8069, 8241, 8265, 8285, 8607, 8625, 8667, 8669, 8847, 8865, 8885, 9092, 9290, 9356, 9736, 9896, 9976, 9992, 10003, 11532, 11598, 11952, 15154, 17574, 20007, 20063, 20841, 22041, 22401, 24029, 24203, 24263, 24623, 26009, 26265, 27029, 28041, 33190, 37396

With multiplication we would need to add 1 or subtract 1. Let's take 28034 as an example of the former where we have:
  • 2 x 8034 + 1 = 16069 is prime

  • 28 x 34 + 1 = 953 is prime

  • 280 x 34 + 1 = 9521 is prime

  • 2803 x 4 + 1 = 11213 is prime
The 421 numbers that satisfy in the range up to 40000 are (permalink):

11, 12, 14, 16, 21, 22, 23, 25, 26, 28, 29, 32, 34, 36, 41, 43, 44, 47, 49, 52, 56, 58, 61, 62, 63, 65, 66, 67, 74, 76, 82, 85, 89, 92, 94, 98, 101, 104, 106, 112, 116, 118, 128, 136, 142, 152, 166, 178, 182, 202, 203, 205, 209, 221, 223, 229, 236, 244, 248, 254, 256, 263, 265, 274, 281, 298, 302, 306, 326, 332, 336, 352, 374, 376, 392, 394, 401, 407, 425, 428, 434, 448, 449, 484, 487, 502, 508, 512, 526, 542, 548, 556, 562, 566, 584, 586, 601, 603, 607, 616, 625, 626, 632, 647, 652, 658, 661, 663, 666, 704, 706, 718, 728, 734, 748, 766, 778, 794, 805, 812, 829, 832, 844, 865, 874, 884, 902, 934, 958, 968, 982, 992, 1001, 1004, 1006, 1018, 1052, 1106, 1108, 1156, 1162, 1178, 1192, 1226, 1228, 1256, 1312, 1352, 1448, 1498, 1568, 1616, 1658, 1708, 1726, 1756, 1862, 1886, 1982, 2002, 2003, 2009, 2023, 2026, 2065, 2074, 2086, 2176, 2204, 2216, 2221, 2228, 2243, 2281, 2306, 2336, 2384, 2386, 2443, 2524, 2576, 2645, 2648, 2686, 2716, 2774, 2776, 2849, 2876, 2998, 3002, 3006, 3034, 3074, 3136, 3152, 3224, 3244, 3302, 3404, 3412, 3526, 3542, 3566, 3574, 3592, 3704, 3734, 3932, 4001, 4007, 4034, 4043, 4078, 4102, 4142, 4168, 4234, 4265, 4274, 4304, 4402, 4423, 4447, 4504, 4685, 4724, 4807, 4825, 4918, 4982, 5008, 5036, 5066, 5162, 5198, 5206, 5302, 5344, 5366, 5506, 5518, 5534, 5542, 5558, 5594, 5608, 5612, 5708, 5726, 5786, 5918, 6001, 6003, 6007, 6056, 6076, 6112, 6166, 6178, 6182, 6245, 6263, 6268, 6382, 6412, 6443, 6452, 6467, 6518, 6536, 6601, 6605, 6607, 6632, 6667, 6766, 6802, 6902, 7004, 7006, 7094, 7118, 7126, 7244, 7384, 7424, 7516, 7606, 7706, 7886, 7918, 7948, 8005, 8042, 8056, 8186, 8201, 8249, 8261, 8266, 8324, 8332, 8462, 8474, 8516, 8536, 8542, 8602, 8662, 8794, 8912, 8942, 8984, 9002, 9034, 9112, 9128, 9158, 9254, 9278, 9428, 9494, 9502, 9532, 9652, 9704, 9748, 9932, 9992, 10004, 10018, 10028, 10136, 10312, 10336, 10448, 11102, 11276, 11482, 11552, 11578, 11608, 11662, 12026, 12206, 12656, 12728, 13256, 13312, 14002, 14098, 14158, 14548, 14758, 14798, 14812, 14968, 15208, 15856, 15952, 16142, 17126, 18116, 18536, 18736, 18962, 19012, 19402, 19768, 19832, 20002, 20021, 20254, 20849, 20866, 21778, 22178, 22616, 22778, 22948, 23834, 23876, 24043, 24118, 24334, 24424, 24824, 25228, 25298, 25366, 25556, 25844, 26005, 26516, 26665, 27028, 27356, 27784, 28034, 28516, 28874, 29708, 30274, 30362, 30662, 30704, 32024, 32066, 32234, 33106, 33182, 33784, 34492, 35206, 36676, 38032, 38362, 38512, 38734, 39532

If instead we subtract 1, we get the following 400 numbers in the range up to 40000 (permalink):

13, 14, 16, 18, 22, 23, 24, 26, 27, 29, 31, 32, 34, 36, 38, 41, 42, 43, 45, 46, 48, 54, 56, 61, 62, 63, 64, 65, 67, 68, 69, 72, 76, 81, 83, 84, 86, 89, 92, 96, 98, 103, 106, 108, 114, 124, 138, 154, 162, 168, 174, 184, 198, 203, 204, 207, 209, 212, 222, 236, 242, 264, 269, 296, 301, 302, 306, 308, 324, 334, 336, 338, 384, 386, 398, 402, 405, 406, 421, 426, 427, 441, 456, 463, 468, 492, 496, 504, 512, 522, 536, 548, 572, 588, 596, 601, 603, 604, 607, 608, 618, 629, 638, 642, 643, 664, 667, 684, 702, 706, 714, 726, 762, 784, 786, 792, 801, 803, 806, 809, 825, 834, 845, 846, 863, 876, 902, 908, 912, 948, 956, 962, 972, 986, 992, 996, 1006, 1038, 1062, 1084, 1104, 1152, 1308, 1314, 1368, 1422, 1504, 1524, 1548, 1608, 1614, 1654, 1662, 1692, 1734, 1752, 1824, 1854, 1864, 1884, 1968, 1992, 2003, 2007, 2012, 2036, 2052, 2064, 2112, 2274, 2427, 2465, 2486, 2609, 2612, 2664, 2724, 2736, 2805, 3002, 3008, 3086, 3198, 3234, 3304, 3318, 3368, 3408, 3498, 3504, 3596, 3624, 3634, 3638, 3668, 3786, 3926, 3976, 4005, 4006, 4021, 4026, 4083, 4152, 4158, 4188, 4207, 4221, 4246, 4272, 4306, 4326, 4396, 4407, 4458, 4692, 4801, 4818, 4843, 4906, 4962, 4992, 5004, 5102, 5148, 5168, 5172, 5202, 5214, 5334, 5376, 5418, 5462, 5492, 5538, 5604, 5622, 5756, 5784, 6001, 6004, 6008, 6012, 6043, 6045, 6067, 6098, 6264, 6308, 6334, 6368, 6402, 6465, 6542, 6603, 6665, 6714, 6754, 6774, 6834, 6858, 6912, 6998, 7002, 7152, 7242, 7422, 7452, 7476, 7546, 7554, 7564, 7806, 7876, 7896, 7926, 7996, 8003, 8006, 8063, 8154, 8184, 8198, 8289, 8445, 8483, 8598, 8685, 8784, 8948, 9296, 9542, 9672, 9756, 9806, 9836, 9902, 9972, 9976, 10014, 10024, 10062, 10234, 10422, 10548, 10662, 11088, 11118, 11202, 12004, 12504, 12522, 12634, 13308, 13638, 14022, 14448, 14592, 14958, 15114, 15438, 15504, 15648, 15684, 16008, 16038, 16654, 16962, 17742, 18054, 18468, 19398, 20007, 20012, 20112, 20154, 20205, 20289, 20427, 20724, 20784, 21102, 21212, 21272, 21774, 21792, 21962, 22014, 22122, 22164, 22212, 22242, 22401, 22605, 22821, 22824, 22962, 23486, 24086, 24602, 25122, 25386, 26004, 26412, 26574, 26669, 27036, 27252, 27542, 27756, 27912, 28056, 28284, 28896, 29072, 29292, 29402, 29702, 30086, 30098, 30604, 30848, 31234, 32004, 32514, 33336, 33354, 33368, 33726, 34908, 35706, 36124, 36168, 37134, 37204, 37356, 38036, 38184, 39006, 39048

Let's take the last member, 39048, as an example:
  • 3 x 9048 - 1 = 27143 is prime

  • 39 x 48 - 1 = 1871 is prime

  • 390 x 48 - 1 = 18719 is prime

  • 3904 x 8 - 1 = 31231 is prime

Wednesday, 7 January 2026

Code for Attractors, Vortices and Captives

Herein is an attempt to organise the code that I've gotten Gemini to write for me regarding attractors, vortices and captives.

Firstly, let's start with the ODD(+) and EVEN(-) algorithm. Here is a permalink to the code that will generate a list of attractors and vortices in decreasing order of their number of captives. It will also generate a summary and a colour-coded graphical display (see Table 1 and Figure 1). The default range is 0 to 40000.


Table 1: ODD(+) and EVEN(-)


Figure 1: red = attractor, orange = vortex, blue = captive

Secondly, let's continue with the ODD(-) and EVEN(+) algorithm. Here is a permalink to the code that will generate a list of attractors and vortices in decreasing order of their number of captives. It will also generate a summary and a colour-coded graphical display (see Table 2 and Figure 2). The default range is 0 to 40000.


Table 2: ODD(-) and EVEN(+)


Figure 2: red = attractor, orange = vortex, blue = captive

Thirdly, let's continue with the PRIME(+) and NON-PRIME(-) algorithm. Here is a permalink to the code that will generate a list of attractors and vortices in decreasing order of their number of captives. It will also generate a summary and a colour-coded graphical display (see Table 3 and Figure 3). The default range is 0 to 40000.


Table 3: PRIME(+) and NON-PRIME(-)


Figure 3: red = attractor, orange = vortex, blue = captive

Fourthly, let's continue with the PRIME(-) and NON-PRIME(+) algorithm. Here is a permalink to the code that will generate a list of attractors and vortices in decreasing order of their number of captives. It will also generate a summary and a colour-coded graphical display (see Table 4 and Figure 4). The default range is 0 to 40000.


Table 4: PRIME(-) and NON-PRIME(+)


Figure 4:  red = attractor, orange = vortex, blue = captive

Saturday, 2 November 2024

Consolidating Fibonacci-like Numbers

In my post titled Additive Fibonacci-like Numbers I was dealing with additive digital roots to generate additional digits after the starting two digits were in place. For example, let's start with 78:$$ \begin{align} 78 \rightarrow 7 + 8 =15 \rightarrow 1+5=6 &\rightarrow 786 \\786 \rightarrow 8+6=14 \rightarrow 1+4=5 &\rightarrow 7865 \\7865 \rightarrow 6+5 =11 \rightarrow 1+1=2 &\rightarrow 78652 \end{align} $$We could keep going forever. The advantage of this approach is that the sum of the two previous digits reduces to a single digit between 1 and 9. Let's call these types of numbers Additive Fibonacci-like Numbers of the First Type. Between 100 and 1,000,000 these numbers are:

101, 112, 123, 134, 145, 156, 167, 178, 189, 191, 202, 213, 224, 235, 246, 257, 268, 279, 281, 292, 303, 314, 325, 336, 347, 358, 369, 371, 382, 393, 404, 415, 426, 437, 448, 459, 461, 472, 483, 494, 505, 516, 527, 538, 549, 551, 562, 573, 584, 595, 606, 617, 628, 639, 641, 652, 663, 674, 685, 696, 707, 718, 729, 731, 742, 753, 764, 775, 786, 797, 808, 819, 821, 832, 843, 854, 865, 876, 887, 898, 909, 911, 922, 933, 944, 955, 966, 977, 988, 999, 1011, 1123, 1235, 1347, 1459, 1562, 1674, 1786, 1898, 1911, 2022, 2134, 2246, 2358, 2461, 2573, 2685, 2797, 2819, 2922, 3033, 3145, 3257, 3369, 3472, 3584, 3696, 3718, 3821, 3933, 4044, 4156, 4268, 4371, 4483, 4595, 4617, 4729, 4832, 4944, 5055, 5167, 5279, 5382, 5494, 5516, 5628, 5731, 5843, 5955, 6066, 6178, 6281, 6393, 6415, 6527, 6639, 6742, 6854, 6966, 7077, 7189, 7292, 7314, 7426, 7538, 7641, 7753, 7865, 7977, 8088, 8191, 8213, 8325, 8437, 8549, 8652, 8764, 8876, 8988, 9099, 9112, 9224, 9336, 9448, 9551, 9663, 9775, 9887, 9999, 10112, 11235, 12358, 13472, 14595, 15628, 16742, 17865, 18988, 19112, 20224, 21347, 22461, 23584, 24617, 25731, 26854, 27977, 28191, 29224, 30336, 31459, 32573, 33696, 34729, 35843, 36966, 37189, 38213, 39336, 40448, 41562, 42685, 43718, 44832, 45955, 46178, 47292, 48325, 49448, 50551, 51674, 52797, 53821, 54944, 55167, 56281, 57314, 58437, 59551, 60663, 61786, 62819, 63933, 64156, 65279, 66393, 67426, 68549, 69663, 70775, 71898, 72922, 73145, 74268, 75382, 76415, 77538, 78652, 79775, 80887, 81911, 82134, 83257, 84371, 85494, 86527, 87641, 88764, 89887, 90999, 91123, 92246, 93369, 94483, 95516, 96639, 97753, 98876, 99999

However, in my previous post, Variations on the Taxi Cab Number, I was not working with the digital roots and this is a severe limitation. The early digits need to be small if the digits are to progress in a Fibonacci-like manner. That's why, in the range of numbers, up to one million, the largest number is 303369. This number is constructed as follows beginning with the first two digits 3 and 0:$$ \begin{align} 30 \rightarrow 3 + 0 &= 3 \rightarrow 303 \\ 303 \rightarrow 0+3 &=3 \rightarrow 3033\\3033 \rightarrow 3 + 3 &= 6 \rightarrow 30336\\30336 \rightarrow 3+6 &= 9 \rightarrow 303369 \end{align}$$We can't go any further because of the final two digits: 6 + 9 = 15. Let's call these types of numbers Additive Fibonacci-like Numbers of the Second Type. Between 100 and 1,000,000 these numbers are:

101, 112, 123, 134, 145, 156, 167, 178, 189, 202, 213, 224, 235, 246, 257, 268, 279, 303, 314, 325, 336, 347, 358, 369, 404, 415, 426, 437, 448, 459, 505, 516, 527, 538, 549, 606, 617, 628, 639, 707, 718, 729, 808, 819, 909, 1011, 1123, 1235, 1347, 1459, 2022, 2134, 2246, 2358, 3033, 3145, 3257, 3369, 4044, 4156, 4268, 5055, 5167, 5279, 6066, 6178, 7077, 7189, 8088, 9099, 10112, 11235, 12358, 20224, 21347, 30336, 31459, 40448, 101123, 112358, 202246, 303369

With bases higher than 10, the 1 to 9 digit limitation can be exceeded. For example in base 16, if we start as before with an initial 78 then a third digit is possible:$$78 \rightarrow 7 + 8 = 15 = F \rightarrow 78F$$Thus we have:$$ \begin{align} 78F_{16} &= 7 \times 16^2 + 8 \times 16 + 15 \\ &=1935_{10} \end{align} $$This means that 1935 is an Additive Fibonacci-like Number of the Second Type in base 16. Here is a list of numbers greater than 27000 and less than 40000 that are "additive Fibonacci-like" and of the "second type" in base 16 (permalink):

  • 28791 --> 7077
  • 29065 --> 7189
  • 29339 --> 729b
  • 29613 --> 73ad
  • 29887 --> 74bf
  • 32904 --> 8088
  • 33178 --> 819a
  • 33452 --> 82ac
  • 33726 --> 83be
  • 37017 --> 9099
  • 37291 --> 91ab
  • 37565 --> 92bd
  • 37839 --> 93cf

Additive Fibonacci-like Numbers of the Second Type in base 16 are thus:

28791, 29065, 29339, 29613, 29887, 32904, 33178, 33452, 33726, 37017, 37291, 37565, 37839

*****************************

Here the numbers greater than 27000 and less than 40000 for base 15:

  • 27128 --> 8088
  • 27370 --> 819a
  • 27612 --> 82ac
  • 27854 --> 83be
  • 30519 --> 9099
  • 30761 --> 91ab
  • 31003 --> 92bd
  • 33910 --> a0aa
  • 34152 --> a1bc
  • 34394 --> a2ce
  • 37301 --> b0bb
  • 37543 --> b1cd

Additive Fibonacci-like Numbers of the Second Type in base 15 are (permalink):

27128, 27370, 27612, 27854, 30519, 30761, 31003, 33910, 34152, 34394, 37301, 37543

*****************************

Here are the numbers greater than 27000 and less than 40000 for base 14 (permalink)

  • 27590 --> a0aa
  • 27802 --> a1bc
  • 30349 --> b0bb
  • 30561 --> b1cd
  • 33108 --> c0cc
  • 35867 --> d0dd
  • 38628 --> 10112

Additive Fibonacci-like Numbers of the Second Type in base 14 are thus:

27590, 27802, 30349, 30561, 33108, 35867, 38628

*****************************

Here are the numbers greater than 27000 and less than 40000 for base 13 (permalink):

  • 28745 --> 10112
  • 31140 --> 11235
  • 33535 --> 12358
  • 35930 --> 1347b

Additive Fibonacci-like Numbers of the Second Type in base 13 are thus:

28745, 31140, 33535, 35930

*****************************

For base 12, there are none between 27000 and 40000 but for base 11 we have (permalink):

  • 29550 --> 20224
  • 31027 --> 21347
  • 32504 --> 2246a

Additive Fibonacci-like Numbers of the Second Type in base 11 are thus:

29550, 31027, 32504

*****************************

Just for completeness I'll now look at bases 10 and lower. For base 10, we have (permalink):

  • 30336 --> 30336
  • 31459 --> 31459

Additive Fibonacci-like Numbers of the Second Type in base 10 are thus:

30336, 31459

*****************************

For base 9 there are none but for base 8 there is one (permalink):

  • 33363 --> 101123

Additive Fibonacci-like Numbers of the Second Type in base 8 are thus :

33363

*****************************

For base 7, we have 

  • 34432 --> 202246

Additive Fibonacci-like Numbers of the Second Type in base 7 are thus:

34432

There are no suitable numbers in the range 27000 to 40000 for bases 2, 3, 4, 5 and 6. I've added this determination of whether a number is additive Fibonacci-like of the second type to my multipurpose algorithm.

RIGHT TO LEFT INSTEAD OF LEFT TO RIGHT

There's no compulsion to proceed from left to right when working with digits and so a new set of numbers can be generated by simply reversing the order of the digits. Thus Additive Fibonacci-like Numbers of the First Type are shown below where digit progression is from right to left:

101, 119, 128, 137, 146, 155, 164, 173, 182, 191, 202, 211, 229, 238, 247, 256, 265, 274, 283, 292, 303, 312, 321, 339, 348, 357, 366, 375, 384, 393, 404, 413, 422, 431, 449, 458, 467, 476, 485, 494, 505, 514, 523, 532, 541, 559, 568, 577, 586, 595, 606, 615, 624, 633, 642, 651, 669, 678, 687, 696, 707, 716, 725, 734, 743, 752, 761, 779, 788, 797, 808, 817, 826, 835, 844, 853, 862, 871, 889, 898, 909, 918, 927, 936, 945, 954, 963, 972, 981, 999, 1101, 1191, 1283, 1375, 1467, 1559, 1642, 1734, 1826, 1918, 2119, 2202, 2292, 2384, 2476, 2568, 2651, 2743, 2835, 2927, 3128, 3211, 3303, 3393, 3485, 3577, 3669, 3752, 3844, 3936, 4137, 4229, 4312, 4404, 4494, 4586, 4678, 4761, 4853, 4945, 5146, 5238, 5321, 5413, 5505, 5595, 5687, 5779, 5862, 5954, 6155, 6247, 6339, 6422, 6514, 6606, 6696, 6788, 6871, 6963, 7164, 7256, 7348, 7431, 7523, 7615, 7707, 7797, 7889, 7972, 8173, 8265, 8357, 8449, 8532, 8624, 8716, 8808, 8898, 8981, 9182, 9274, 9366, 9458, 9541, 9633, 9725, 9817, 9909, 9999, 11918, 12835, 13752, 14678, 15505, 15595, 16422, 17348, 18265, 19182, 21101, 21191, 22927, 23844, 24761, 25687, 26514, 27431, 28357, 29274, 31283, 32119, 33936, 34853, 35779, 36606, 36696, 37523, 38449, 39366, 41375, 42202, 42292, 43128, 44945, 45862, 46788, 47615, 48532, 49458, 51467, 52384, 53211, 54137, 55954, 56871, 57707, 57797, 58624, 59541, 61559, 62476, 63303, 63393, 64229, 65146, 66963, 67889, 68716, 69633, 71642, 72568, 73485, 74312, 75238, 76155, 77972, 78808, 78898, 79725, 81734, 82651, 83577, 84404, 84494, 85321, 86247, 87164, 88981, 89817, 91826, 92743, 93669, 94586, 95413, 96339, 97256, 98173, 99909, 99999

Similarly Additive Fibonacci-like Numbers of the Second Type are shown below where digit progression is from right to left:

101, 202, 211, 303, 312, 321, 404, 413, 422, 431, 505, 514, 523, 532, 541, 606, 615, 624, 633, 642, 651, 707, 716, 725, 734, 743, 752, 761, 808, 817, 826, 835, 844, 853, 862, 871, 909, 918, 927, 936, 945, 954, 963, 972, 981, 1101, 2202, 3211, 3303, 4312, 4404, 5321, 5413, 5505, 6422, 6514, 6606, 7431, 7523, 7615, 7707, 8532, 8624, 8716, 8808, 9541, 9633, 9725, 9817, 9909, 21101, 42202, 53211, 63303, 74312, 84404, 85321, 95413, 321101, 642202, 853211, 963303

If we proceed from left to right, then the third digit is the difference between the first and second digits and so on (this is the subtraction sequence mentioned in my previous post).

Friday, 1 November 2024

A Variation on the Taxi Cab Number


The number 1729 is famous as the so-called "taxi cab number" in memory of the interchange between the mathematicians Hardy and Ramanujan in which the latter observed that the number of the taxi cab in which the former had arrived at the hospital was far from boring (as Hardy had thought). Instead 1729 is the first positive integer that is the sum of two positive cubes in two different ways:$$ \begin{align} 1729 &= 1^3+12^3\\ &= 9^3+10^3 \end{align} $$Today I observed a taxi with the number plate T 3257 and noted that there is a touch of Fibonacci about its digits because:$$ 3 +2 = 5 \text{ and } 2 + 5 = 7$$The digits thus form a Fibonacci-type sequence:$$ 3, 2, 5, 7$$This got me thinking about what numbers with three or more digit have this Fibonacci-like property. Well, up to one million, there are only 82 such numbers so they form a rather exclusive club. 


Here they are (permalink) in a sequence that we'll called the ADDITION SEQUENCE:

101, 112, 123, 134, 145, 156, 167, 178, 189, 202, 213, 224, 235, 246, 257, 268, 279, 303, 314, 325, 336, 347, 358, 369, 404, 415, 426, 437, 448, 459, 505, 516, 527, 538, 549, 606, 617, 628, 639, 707, 718, 729, 808, 819, 909, 1011, 1123, 1235, 1347, 1459, 2022, 2134, 2246, 2358, 3033, 3145, 3257, 3369, 4044, 4156, 4268, 5055, 5167, 5279, 6066, 6178, 7077, 7189, 8088, 9099, 10112, 11235, 12358, 20224, 21347, 30336, 31459, 40448, 101123, 112358, 202246, 303369

I have made a related post titled Additive Fibonacci-like Numbers on the 7th August 2024 but this involved finding the digital roots of numbers unlike what I've done here. So for me 3257 will remain my personal taxi cab number.

Another sequence will emerge if, instead of adding the second number to the first and so on, we SUBTRACT the second from the first and so on. In this scenario, 3211 would satisfy because:$$  3 - 2 = 1 \text{ and } 2 -1 =1$$Up to one million, there are 99 such numbers of three digits or more. Here they are in a sequence we'll call the SUBTRACTION SEQUENCE (permalink):

101, 110, 202, 211, 220, 303, 312, 321, 330, 404, 413, 422, 431, 440, 505, 514, 523, 532, 541, 550, 606, 615, 624, 633, 642, 651, 660, 707, 716, 725, 734, 743, 752, 761, 770, 808, 817, 826, 835, 844, 853, 862, 871, 880, 909, 918, 927, 936, 945, 954, 963, 972, 981, 990, 1101, 2110, 2202, 3211, 3303, 4220, 4312, 4404, 5321, 5413, 5505, 6330, 6422, 6514, 6606, 7431, 7523, 7615, 7707, 8440, 8532, 8624, 8716, 8808, 9541, 9633, 9725, 9817, 9909, 21101, 32110, 42202, 53211, 63303, 64220, 74312, 84404, 85321, 95413, 96330, 321101, 532110, 642202, 853211, 963303

It can be noted that some numbers containing zero feature in both sequences. These numbers are 101, 202, 303, 404, 505, 606, 707, 808 and 909.

While we're at it why not consider multiplication in which the first two digits multiply together to give the third digit and so on. In the range up to one million, there are 78 such numbers and here they are in a sequence we'll call the MULTIPLICATION SEQUENCE (permalink):

100, 111, 122, 133, 144, 155, 166, 177, 188, 199, 200, 212, 224, 236, 248, 300, 313, 326, 339, 400, 414, 428, 500, 515, 600, 616, 700, 717, 800, 818, 900, 919, 1000, 1111, 1224, 1339, 2000, 2122, 2248, 3000, 3133, 4000, 4144, 5000, 5155, 6000, 6166, 7000, 7177, 8000, 8188, 9000, 9199, 10000, 11111, 12248, 20000, 21224, 30000, 31339, 40000, 50000, 60000, 70000, 80000, 90000, 100000, 111111, 200000, 212248, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000

An example is 212248 where we have:$$2 \times 1 = 2, \, 2 \times 1 = 2, \, 2 \times 2 = 4 \text{ and } 4 \times 2 = 8$$The zeros of course make some of these numbers a little trivial and so with the digit 0 excluded we have 41 suitable numbers (permalink) in a sequence we'll call the MULTIPLICATION WITHOUT ZERO SEQUENCE:

111, 122, 133, 144, 155, 166, 177, 188, 199, 212, 224, 236, 248, 313, 326, 339, 414, 428, 515, 616, 717, 818, 919, 1111, 1224, 1339, 2122, 2248, 3133, 4144, 5155, 6166, 7177, 8188, 9199, 11111, 12248, 21224, 31339, 111111, 212248

If we consider dividing the second digit into the first to give the third digit and so on then, excluding numbers with zero, we have the following numbers (permalink) in what we'll call the DIVISION WITHOUT ZERO SEQUENCE:

111, 212, 221, 313, 331, 414, 422, 441, 515, 551, 616, 623, 632, 661, 717, 771, 818, 824, 842, 881, 919, 933, 991, 1111, 2212, 3313, 4221, 4414, 5515, 6616, 7717, 8422, 8818, 9331, 9919, 11111, 42212, 84221, 93313, 111111, 842212

Many of the numbers in the division sequence are not surprisingly the reverse of numbers in the multiplication sequence e.g. 842212 in the division sequence is the reverse of 212248 in the multiplication sequence.

Friday, 4 October 2024

Semiprime Chains

The number associated with my diurnal age today is 27578 and it is a squarefree semiprime with an interesting property. Let's consider its two factors and subtract the smaller from the larger factor and apply the same rule to the difference. Keep repeating this process until the difference is not a squarefree semiprime. The result is as follows:$$ \begin{align} 27578 &= 2 \times 13789\\ 13789-2 &= 13787 \\13787 &= 17 \times 811\\811-17 &=794 \\794 &= 2 \times 397\\397-2 &= 395 \\ 395 &= 5 \times 79 \\79 -5 &= 74 \\ 74 &= 2 \times 37\\37-2 &= 35\\35 &= 5 \times 7 \end{align}$$Once we reach 35, the chain of semiprimes terminates because the difference between 7 and 5 is 2 and 2 is not a squarefree semiprime. However, the process does generate a chain of semiprimes:$$27578 \rightarrow 13787 \rightarrow 794 \rightarrow 395 \rightarrow 74 \rightarrow 35$$Squarefree semiprimes like 27578 that produce another five squarefree semiprimes by subtraction of their prime factors belong to OEIS A296812:


A296812
    Take a squarefree semiprime and take the difference of its prime factors. If it is a squarefree semiprime repeat the process. Sequence lists the squarefree semiprimes that generate other squarefree semiprimes only in the first \(k\) steps of this process. Case \(k \geq 5\).

The initial members of this sequence, up to 40000, are (permalink):

4786, 5991, 6218, 8351, 9995, 13391, 14367, 15434, 16658, 16706, 18663, 19466, 27578, 28738, 33551, 34082, 34187, 37727, 38823

The numbers marked in red correspond to the case where \(k \geq 6\), although these numbers are not listed in the OEIS. Take 33551 as an example:$$ \begin{align} 33551 &= 7 \times 4793\\4793 - 7 &= 4786\\4786 &= 2 \times 2393\\2393-2 &= 2391\\2391 &= 3 \times 797\\797-3 &= 794\\794 &= 2 \times 397\\397-2 &= 395\\ 395 &= 5 \times 79\\ 79 - 5 &=74\\74 &= 2 \times 37\\37-2 &=35\\35 &= 5 \times 7 \end{align}$$The number in blue in the list above (28738) corresponds to the case where \(k\)=7 and the prime factors of this number are 2 x 14369 which leads us to 14367 (one of the red numbers).

A similar process involving addition of the prime factors could be applied this would lead, in the case of \(k \geq 5\), to this sequence of numbers:

1774, 2566, 2913, 4497, 6382, 6769, 8902, 9286, 10334, 15177, 19357, 28177, 34669, 35913, 37857

Take 1774 as an example where we have:$$ \begin{align} 1774 &= 2 \times 887\\ 887+2 &= 889\\889 &= 7 \times 127\\127+7 &=134\\134 &= 2 \times 67\\67+2 &= 69\\ 69 &= 3 \times 23\\23+3 &= 26\\26 &= 2 \times 13\\13+2 &=15\\15 &= 3 \times 5 \end{align} $$These numbers are NOT listed in the OEIS. I'm sure some of these numbers could be taken further as with the differences but I'll leave it there for now.

Wednesday, 7 August 2024

Subtractive Fibonacci-like Numbers

Consider all two digit numbers from 10 to 99 and use these as the seed digits that will generate a third number NOT by ADDITION of the two digits but by SUBTRACTION, subtracting the smaller digit from the larger when they are different. This ensures that the result is always positive or zero. Taking the absolute value of the result is another way to regard it. Here are the 90 numbers.

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99

These 90 two digit numbers will generate another 90 three digit numbers. These are:

101, 110, 121, 132, 143, 154, 165, 176, 187, 198, 202, 211, 220, 231, 242, 253, 264, 275, 286, 297, 303, 312, 321, 330, 341, 352, 363, 374, 385, 396, 404, 413, 422, 431, 440, 451, 462, 473, 484, 495, 505, 514, 523, 532, 541, 550, 561, 572, 583, 594, 606, 615, 624, 633, 642, 651, 660, 671, 682, 693, 707, 716, 725, 734, 743, 752, 761, 770, 781, 792, 808, 817, 826, 835, 844, 853, 862, 871, 880, 891, 909, 918, 927, 936, 945, 954, 963, 972, 981, 990

These in turn will spawn another 90 numbers. These are:

1011, 1101, 1211, 1321, 1431, 1541, 1651, 1761, 1871, 1981, 2022, 2110, 2202, 2312, 2422, 2532, 2642, 2752, 2862, 2972, 3033, 3121, 3211, 3303, 3413, 3523, 3633, 3743, 3853, 3963, 4044, 4132, 4220, 4312, 4404, 4514, 4624, 4734, 4844, 4954, 5055, 5143, 5231, 5321, 5413, 5505, 5615, 5725, 5835, 5945, 6066, 6154, 6242, 6330, 6422, 6514, 6606, 6716, 6826, 6936, 7077, 7165, 7253, 7341, 7431, 7523, 7615, 7707, 7817, 7927, 8088, 8176, 8264, 8352, 8440, 8532, 8624, 8716, 8808, 8918, 9099, 9187, 9275, 9363, 9451, 9541, 9633, 9725, 9817, 9909

These in turn will spawn another 90 numbers. These are:

10110, 11011, 12110, 13211, 14312, 15413, 16514, 17615, 18716, 19817, 20220, 21101, 22022, 23121, 24220, 25321, 26422, 27523, 28624, 29725, 30330, 31211, 32110, 33033, 34132, 35231, 36330, 37431, 38532, 39633, 40440, 41321, 42202, 43121, 44044, 45143, 46242, 47341, 48440, 49541, 50550, 51431, 52312, 53211, 54132, 55055, 56154, 57253, 58352, 59451, 60660, 61541, 62422, 63303, 64220, 65143, 66066, 67165, 68264, 69363, 70770, 71651, 72532, 73413, 74312, 75231, 76154, 77077, 78176, 79275, 80880, 81761, 82642, 83523, 84404, 85321, 86242, 87165, 88088, 89187, 90990, 91871, 92752, 93633, 94514, 95413, 96330, 97253, 98176, 99099

Let's forget about our two digit starting numbers and consider only the resulting three, four and five digit numbers. Grouping them all together we have the following 270 member sequence:

101, 110, 121, 132, 143, 154, 165, 176, 187, 198, 202, 211, 220, 231, 242, 253, 264, 275, 286, 297, 303, 312, 321, 330, 341, 352, 363, 374, 385, 396, 404, 413, 422, 431, 440, 451, 462, 473, 484, 495, 505, 514, 523, 532, 541, 550, 561, 572, 583, 594, 606, 615, 624, 633, 642, 651, 660, 671, 682, 693, 707, 716, 725, 734, 743, 752, 761, 770, 781, 792, 808, 817, 826, 835, 844, 853, 862, 871, 880, 891, 909, 918, 927, 936, 945, 954, 963, 972, 981, 990, 1011, 1101, 1211, 1321, 1431, 1541, 1651, 1761, 1871, 1981, 2022, 2110, 2202, 2312, 2422, 2532, 2642, 2752, 2862, 2972, 3033, 3121, 3211, 3303, 3413, 3523, 3633, 3743, 3853, 3963, 4044, 4132, 4220, 4312, 4404, 4514, 4624, 4734, 4844, 4954, 5055, 5143, 5231, 5321, 5413, 5505, 5615, 5725, 5835, 5945, 6066, 6154, 6242, 6330, 6422, 6514, 6606, 6716, 6826, 6936, 7077, 7165, 7253, 7341, 7431, 7523, 7615, 7707, 7817, 7927, 8088, 8176, 8264, 8352, 8440, 8532, 8624, 8716, 8808, 8918, 9099, 9187, 9275, 9363, 9451, 9541, 9633, 9725, 9817, 9909, 10110, 11011, 12110, 13211, 14312, 15413, 16514, 17615, 18716, 19817, 20220, 21101, 22022, 23121, 24220, 25321, 26422, 27523, 28624, 29725, 30330, 31211, 32110, 33033, 34132, 35231, 36330, 37431, 38532, 39633, 40440, 41321, 42202, 43121, 44044, 45143, 46242, 47341, 48440, 49541, 50550, 51431, 52312, 53211, 54132, 55055, 56154, 57253, 58352, 59451, 60660, 61541, 62422, 63303, 64220, 65143, 66066, 67165, 68264, 69363, 70770, 71651, 72532, 73413, 74312, 75231, 76154, 77077, 78176, 79275, 80880, 81761, 82642, 83523, 84404, 85321, 86242, 87165, 88088, 89187, 90990, 91871, 92752, 93633, 94514, 95413, 96330, 97253, 98176, 99099

The sequence will continue indefinitely and what drew my attention to these types of numbers was the number associated with my diurnal age today, 27520. I noticed that it almost qualified because 7 - 2 = 5, 7 - 5 = 2 but 5 - 2 does not produce the required final digit of 3. However, in three more days it will when my diurnal age reaches 27523 days. The next number in the sequence is 28624 which is some three years away. Such numbers are certainly not frequent so they deserve to be given some attention.

Viewed as a Fibonacci-like sequence of numbers, the sequences all settle down to a repetitive \(0, n, n\) pattern where \(n\) is a digit between 1 and 9. For example, 27523 becomes:$$2, 7, 5, 2, 3, 1, 2, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, \dots$$The fact that the absolute value of the repeated subtraction of the two digits cannot produce numbers greater than 9 ensures eventual repetition. Subtraction aside, there are similar sequences to explore like adding the first two digits together to produce a third number that is not the sum of the first two, as in the Fibonacci sequence, but the DIGITAL ROOT of the number. For example:$$ \begin{align} 27 &\rightarrow 279 \\279 &\rightarrow 2797 \text{ since } 9 + 7 = 16 \rightarrow 7 \\ 2797 &\rightarrow 27977 \end{align} $$This sequence will be examined in my next post.

Monday, 5 August 2024

Forming Digit Equations: A Game

Source

It occurred to me how forming digit equations from five digits might make for an interesting game. After all, Wordle consists of guessing the five letters that make up a hidden word. In the game I'm conceiving of, a five digit number between 10000 and 99999 would be generated. Let's say the number generated is 25529. The challenge is to use only the following operators to form a digit equation without altering the order of the digits:

+    addition

-    subtraction

x    multiplication

/    divide by

|    divide into

^    exponentiation

(     left bracket

)    right bracket

Figure 1 shows one possible representation:

Figure 1

The same digit equation would look mathematically as follows:$$ \Big ( 2 + \frac{5}{5} \Big )^2=9$$This is somewhat on the difficult side. Obviously an effective game nowadays involves a catchy user interface so coloured balls that pop up to start the game would be effective. The operators shown above would need to be able to be dragged and dropped between the digits in order to generate the equation. The successful creation of an equation would need to be displayed in mathematically readable way such as was done with the example of 25529.

The game could have different levels starting at the fairly elementary level. For example, 10348 could be rendered as:$$1+0+3+4=8$$This equation involves only the a single operation, addition, and the correct placement of the equal sign. By contrast, 25529 is considerably more challenging and involves the use of brackets, addition, division and exponentiation. Of course, for some numbers it is impossible to form an equation within the imposed constraints. An example is 27497 which is unsolvable as far as I can see. This is a long term project but something that I will keep thinking about or perhaps I'll discover that someone has already created such a game. Who knows?

For earlier posts on this theme see my posts titled The Number Plate Game from the 29th June 2024 and Forming Equations from the Digits of a Number on 14th March 2024. To generate some random five digits numbers follow this permalink.

Tuesday, 30 July 2024

Hidden Palindromes

One of the properties of the number associated with my diurnal age today (27512) has an interesting property that is listed in its Numbers Aplenty entry. 

27512 is a number such that
27512 - product of digits (140) = 27372
a palindromic number

This is by no means obvious at first glance and I wondered how many other numbers in the range up to 40,000 have this property that might formally be stated as follows:

\(n\) is a number such that
\(n\) - product of digits of \(n\) = a palindromic number

It didn't long to discover that there are 320 such numbers in the range up to 40,000. We must remember to exclude numbers containing the digit 0 because in that case the product of the digits will be zero. I'll only list the numbers here between 27512 and 40000 (permalink):

27512, 27582, 27666, 28128, 28184, 28336, 28352, 28398, 28466, 28852, 28924, 28974, 29246, 29562, 29592, 29664, 29778, 29784, 29997, 31231, 31429, 31781, 32199, 32513, 32563, 32627, 32631, 32717, 32753, 33341, 33427, 33477, 33619, 33981, 34237, 34453, 34629, 34691, 34831, 34939, 34953, 35273, 35323, 35483, 35543, 35663, 35813, 35963, 36139, 36563, 36777, 36796, 36888, 36968, 37241, 37419, 38261, 38353, 38593, 38747, 38817, 38867, 38931, 39287, 39489, 39617, 39779

Having subtraced the product of a number's digits, it's natural to consider adding this same product instead of subtracting it. Thus we are searching now for numbers with the property that:

\(n\) is a number such that
\(n\) + product of digits of \(n\) = a palindromic number

There are 305 such numbers in the range up to 40000 with this property and again I've only listed the numbers in a selected range, here between 27889 and 40000 (permalink)

27889, 28452, 28477, 28563, 28572, 28583, 28616, 28624, 28797, 28867, 28953, 29269, 29352, 29377, 29512, 29553, 29593, 31271, 31523, 31641, 31667, 31961, 31989, 32187, 32211, 32353, 32499, 32671, 32841, 32999, 34189, 34277, 34319, 34553, 34647, 34749, 34781, 35383, 35443, 35579, 35623, 35984, 36439, 36563, 36617, 36641, 36648, 36778, 36876, 36911, 36968, 37621, 37686, 37854, 37898, 37959, 37981, 38229, 38311, 38453, 38584, 38717, 38868, 38936, 39231, 39454, 39498, 39524, 39579, 39632, 39646, 39754

Let's take the first number in the previous list, 27889, we see that:

27889 is a number such that
27889 + product of digits (8064) = 35953
a palindromic number

What about numbers that become palindromic when the product of digits is both subtracted and added? We are looking for numbers with these criteria:

\(n\) is a number such that
\(n\) - product of digits of \(n\) = a palindromic number
\(n\) + product of digits of \(n\) = a palindromic number

It turns out that there are 15 of these in the range up 40000, most but not all being palindromic themselves. They are:

1, 2, 3, 4, 247, 252, 348, 843, 15451, 25152, 25252, 25352, 25452, 36563, 36968

Let's take 25452, palindromic itself, as an example:

25452 is a number such that
25452 - product of digits (400) = 25052
25452 + product of digits (400) = 25852
both are palindromic numbers

We can do the same thing with the sum of the digits of a number by subtracting or adding the sum to the number itself. There are 499 and 507 palindromes respectively that result from these two processes. The earlier algorithm is easily modified to generate a list of these numbers. Thus we can search for:

\(n\) is a number such that
\(n\) - sum of digits of \(n\) = a palindromic number

Here is a list of numbers satisfying this criterion from 28800 to 40000 (permalink):

28800, 28801, 28802, 28803, 28804, 28805, 28806, 28807, 28808, 28809, 29610, 29611, 29612, 29613, 29614, 29615, 29616, 29617, 29618, 29619, 30310, 30311, 30312, 30313, 30314, 30315, 30316, 30317, 30318, 30319, 31120, 31121, 31122, 31123, 31124, 31125, 31126, 31127, 31128, 31129, 32840, 32841, 32842, 32843, 32844, 32845, 32846, 32847, 32848, 32849, 33650, 33651, 33652, 33653, 33654, 33655, 33656, 33657, 33658, 33659, 34460, 34461, 34462, 34463, 34464, 34465, 34466, 34467, 34468, 34469, 35270, 35271, 35272, 35273, 35274, 35275, 35276, 35277, 35278, 35279, 36080, 36081, 36082, 36083, 36084, 36085, 36086, 36087, 36088, 36089, 36990, 36991, 36992, 36993, 36994, 36995, 36996, 36997, 36998, 36999, 38600, 38601, 38602, 38603, 38604, 38605, 38606, 38607, 38608, 38609, 39410, 39411, 39412, 39413, 39414, 39415, 39416, 39417, 39418, 39419

Let's take the first of these as an example:

27889 is a number such that
27889 - sum of digits (18) = 28782
a palindromic number

Next we can for look numbers meeting the following criterion:

\(n\) is a number such that
\(n\) + sum of digits of \(n\) = a palindromic number

Here is a list of such numbers in the range from 27547 to 40000 (permalink): 

27547, 27651, 27746, 27850, 27945, 28063, 28158, 28262, 28357, 28461, 28556, 28660, 28755, 28954, 29072, 29167, 29271, 29366, 29470, 29565, 29764, 29859, 29963, 29973, 30000, 30086, 30190, 30285, 30484, 30579, 30683, 30778, 30882, 30991, 31095, 31104, 31294, 31303, 31389, 31493, 31502, 31588, 31692, 31701, 31787, 31891, 31900, 32009, 32113, 32199, 32208, 32312, 32398, 32407, 32511, 32597, 32606, 32710, 32796, 32805, 33018, 33122, 33217, 33321, 33416, 33520, 33615, 33814, 33909, 34027, 34131, 34226, 34330, 34425, 34624, 34719, 34823, 34918, 35036, 35140, 35235, 35434, 35529, 35633, 35728, 35832, 35927, 36045, 36244, 36339, 36443, 36538, 36642, 36737, 36841, 36936, 37054, 37149, 37253, 37348, 37452, 37547, 37651, 37746, 37850, 37945, 38063, 38158, 38262, 38357, 38461, 38556, 38660, 38755, 38954, 39072, 39167, 39271, 39366, 39470, 39565, 39764, 39859, 39963, 39973, 40000

Let's take 27547 as an example:

27547 is a number such that
27547 + sum of digits (25) = 
27572
a palindromic number

What about numbers that result in palindromes when the sum of digits is subtracted and added? We are looking for numbers with these criteria:

\(n\) is a number such that
\(n\) - sum of digits of \(n\) = a palindromic number
\(n\) + sum of digits of \(n\) = a palindromic number

There are 23 such numbers in the range up to 40000 with some but not all being palindromic themselves (permalink):

1, 2, 3, 4, 10, 100, 105, 181, 262, 267, 343, 348, 424, 429, 681, 762, 767, 843, 848, 924, 929, 1000, 10000

Let's take 1000 as an example:

1000 is a number such that
1000 - sum of digits (1) = 999
1000 + sum of digits (1) = 1001
both are palindromic numbers

I've written about sequences arising from numbers in combination with their sum of digits (SoD) or product of digits (PoD) in earlier posts such as:
I've also written extensively about palindromes in posts such as: