Showing posts with label addition. Show all posts
Showing posts with label addition. 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, 20 December 2025

Building Block Numbers Revisited

In January of 2025, I created a post titled Building Block Numbers about a very small set of positive integers that can be used to construct all other positive integers. These numbers form OEIS A086424:


A086424 Numbers needed to generate all other natural numbers, only allowing multiplication and addition. Each number can be used only once.


The initial numbers are: 

1, 2, 4, 11, 25, 64, 171, 569, 3406, 27697, 243374, 1759619, 28381401, 222323189, 3416307938, 26838745347, ...

Take my diurnal age today: 28020. Using these building blocks we can represent the number as (permalink):$$28020=(4 \times (171 + (2 \times (11 + 3406))))$$Let's compare this to its represention using products of primes:$$28020=2 \times 2 \times 3 \times 5 \times 467$$At first the difference in economy isn't apparent. Both methods require five numbers. With the first method we cannot repeat any of the numbers but with the second we can. The economy becomes apparent however, when we consider that up to but not including 243374, we only need ten building blocks (1, 2, 4, 11, 25, 64, 171, 569, 3406 and 27697) for every number in the range from 1 to 243373. It is only when we reach 243374 that an additional building block is required. By contrast there are 21494 primes in the same range and each of them is unique and can't be built out of smaller primes.

I got Gemini's NotebookLM to create an infographic and a video about these building blocks:


Infographic created by NotebookLM based on this blog post

The thing about these building blocks is that are independent of the number base being used. Table 1 shows the comparison of the base 10 with bases of 2, 8 and 16.


Table 1: 
permalink
Here is the video:


I've incorporated this way of building a number into the SageMath algorithm that I use to analyse the number associated with my diurnal age. However, as I thought about the code that Gemini had generated I remembered that there would often be more ways than one to represent a number and I realised that Gemini was serving up the first combination of building blocks that it came across. I then got Gemini to modify its code to display all possible solutions. For 28020, this turned out to be a staggering 796 solution. Many of these however, involved multiplication by 1. I asked Gemini to exclude these and the number fell to 166. Many of these involved the unnecessary use of brackets. After removing these, the final number came down to 16.

Found 16 unique, simplified solution(s):

\(28020 = 171 + 25 \times 569 + 3406 \times 4 \)
\(28020 = 4 \times (171 + 2 \times (11 + 3406)) \)
\(28020 = 171 + 27697 + 64 + 11 \times 2 \times 4 \)
\(28020 = 171 + 27697 + 4 \times (11 + 2 + 25) \)
\(28020 = 171 + 27697 + 2 \times (1 + 11 + 64) \)
\(28020 = 1 + 171 + 2 \times 4 \times (11 + 3406 + 64) \)
\(28020 = 1 + 2 + 11 \times (171 + 4 \times (25 + 569)) \)
\(28020 = 171 + 25 + 4 \times (2 \times 64 + 569 \times (1 + 11)) \)
\(28020 = 3406 + 569 + (1 + 2 + 25 \times 64) \times (11 + 4) \)
\(28020 = 1 + 569 + 64 + 2 \times (25 + 4 \times (11 + 3406)) \)
\(28020 = 3406 \times 4 + (1 + 171 + 64) \times (11 + 2 \times 25) \)
\(28020 = 11 + 25 + 171 \times 64 + (1 + 4) \times (2 + 3406) \)
\(28020 = 4 \times (1 + 11 \times (25 + 569) + 2 \times (171 + 64)) \)
\(28020 = 2 \times (3406 + 4 \times (1 + 569 + 11 \times 171)) + 25 \times 64 \)
\(28020 = 3406 + 64 + 2 * (25 + (1 + 4) \times (569 + 11 * 171)) \)
\(28020 = (1 + 4) \times (171 + 3406 + 569 + 2 \times (25 + 11 \times 64)) \)

Looking at these solutions it can be seen that they are ordered by number of terms used, fewer to more numerous. The first two solutions require only five building blocks and thus of course are to be preferred.

Friday, 31 January 2025

Building Block Numbers

The prime numbers are considered the building blocks of the positive integers because every composite number can be expressed as a product of prime numbers. However, the OEIS A086424 offers an alternative set of building blocks:


A086424 Numbers needed to generate all other natural numbers, only allowing multiplication and addition. Each number can be used only once.


These numbers are: 

1, 2, 4, 11, 25, 64, 171, 569, 3406, 27697, 243374, 1759619, 28381401, 222323189, 3416307938, 26838745347

Here is an extract from the OEIS comments:
  • 10 is not in the sequence because (4+1)*2 = 10.
  • 11 is in the sequence because there is no way to get 11 by using the earlier terms.
  • 509 is not in the sequence because
    509 = (1+25)*(2+11)+171.
The number associated with my diurnal age today is 27697 and this is the first number that cannot be expressed in terms of the numbers 1, 2, 4, 11, 25, 64, 171, 569 and 3406 using only multiplication or addition and using each number only once. From now on, up to but not including 243374, every number can be expressed in terms of 1, 2, 4, 11, 25, 64, 171, 569, 3406 and 27697. This is a big deal.

GEMINI WAS ABLE TO CHANGE PARI CODE
TO PYTHON AFTER A FEW TRIES

The OEIS comments offer some PARI code to generate this list of numbers and, after many errors on the part of Gemini, I was able to get to produce some working PYTHON code that will do the same job, albeit slowly. Here is the code:

from sage.all import *

def Ww(v):
    """
    Calculates the Ww function for a given list of integers.
    Args:
        v: A list of integers.
    Returns:
        A list of integers resulting from the Ww function.
    """
    if len(v) == 2:
        return [v[0], v[1], v[0] + v[1], v[0] * v[1]]
    else:
        V = []
        for i in range(len(v)):
            for j in range(i + 1, len(v)):
                t = v[:i] + v[i+1:j] + v[j+1:]
                if t:
                    V.extend(Ww(t + [v[i] + v[j]]))
                    V.extend(Ww(t + [v[i] * v[j]]))
        return sorted(set(V))  # Remove duplicates
a = [Integer(1), Integer(2), Integer(4)]
for n in range(3, 10):
    V = Ww(a)
    for i in range(2 * a[-1], len(V) + 1):
        if V[i - 1] > i:
            a.append(i)
            print(f"a = {a}")
            break
    else:
        print(f"No solution found for n = {n}")  
 

EVERY NUMBER UP TO BUT NOT INCLUDING 27697
CAN BE EXPRESSED IN TERMS OF
1, 2, 4, 11, 25, 64, 171, 569 and 3406
USING ONLY ADDITION AND MULTIPLICATION
AND USING ONE NUMBER ONLY ONCE

Of course the execution of this code on SageMathCell will quickly time out and it will only generate the numbers up to 171. However, running it in a Jupyter notebook on an M1 Macbook Air, it will generate the numbers up to 3406 fairly quickly but after an hour or so it never got to 27697 so I stopped it. 

I asked Gemini to come up with an algorithm in Python to express a given number in terms of these new "building blocks" but it consistently failed so I gave up. However, it will be easy initially for numbers greater than 27697. For example:

  • 27698 = 27697 + 1
  • 27699 = 27697 + 2
  • 27700 = 27697 + 2 + 1
  • 27701 = 27697 + 4 etc.

I'll continue to do this as an exercise associated with my daily number analysis. Figure 1 shows an analysis of the building block numbers and their factors. It can be seen that the only prime numbers are 2, 11, 569 and 27697. It should be noted that the property these numbers have collectively is NOT base dependent.

Figure 1

These particular building blocks are remarkably economical considering how many unique primes we would require to "build" all the numbers from 2 to 27697. It is in fact 3020. These blocks only require nine blocks: 1, 2, 4, 11, 25, 64, 171, 569 and 3406. They become even more economical for larger numbers. For example in the range up to 243373 (one less than 243374), we require 21494 unique primes but only ten of our new building blocks: 1, 2, 4, 11, 25, 64, 171, 569, 3406 and 27697. However, unlike the prime building blocks, representations using these new building blocks are not unique. For example, 12 can be represented as 11 + 1 or (1 + 2) * 4. Remember, bracketing is allowed.

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.

Wednesday, 7 August 2024

Additive Fibonacci-like Numbers

Consider all two digit numbers from 10 to 99 and use these as the seed digits that will generate a third digit by ADDITION of the two digits and by then finding the DIGITAL ROOT of the resultant sum. Here are the 90 starting 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, 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

These in turn will produce 90 four digit numbers. These are:

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

These in turn will produce 90 five digit numbers. These are:

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

Forgetting about the original two digit numbers, let's group all the three, four and five digits number together so that we have 270 numbers. These 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

Viewed as a Fibonacci-like sequence, the sequence of digits will eventually cycle. Take 27977 as an example. The progression is:$$2, 7, 9, 7, 7, 5, 3, 8, 2, 1, 3, 4, 7, 2, 9, 2, 2, 4, 6, 1, 7, 8, 6, 5, 2, 7, 9, 7, 7, \dots $$An alternative to this progression of digits is to determine the arithmetical digital root of the cumulative sum of digits and use this as the next digit. Here is a permalink that will generate this sequence of 270 numbers. Here are the numbers:

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, 1012, 1124, 1236, 1348, 1451, 1563, 1675, 1787, 1899, 1912, 2024, 2136, 2248, 2351, 2463, 2575, 2687, 2799, 2812, 2924, 3036, 3148, 3251, 3363, 3475, 3587, 3699, 3712, 3824, 3936, 4048, 4151, 4263, 4375, 4487, 4599, 4612, 4724, 4836, 4948, 5051, 5163, 5275, 5387, 5499, 5512, 5624, 5736, 5848, 5951, 6063, 6175, 6287, 6399, 6412, 6524, 6636, 6748, 6851, 6963, 7075, 7187, 7299, 7312, 7424, 7536, 7648, 7751, 7863, 7975, 8087, 8199, 8212, 8324, 8436, 8548, 8651, 8763, 8875, 8987, 9099, 9112, 9224, 9336, 9448, 9551, 9663, 9775, 9887, 9999, 10124, 11248, 12363, 13487, 14512, 15636, 16751, 17875, 18999, 19124, 20248, 21363, 22487, 23512, 24636, 25751, 26875, 27999, 28124, 29248, 30363, 31487, 32512, 33636, 34751, 35875, 36999, 37124, 38248, 39363, 40487, 41512, 42636, 43751, 44875, 45999, 46124, 47248, 48363, 49487, 50512, 51636, 52751, 53875, 54999, 55124, 56248, 57363, 58487, 59512, 60636, 61751, 62875, 63999, 64124, 65248, 66363, 67487, 68512, 69636, 70751, 71875, 72999, 73124, 74248, 75363, 76487, 77512, 78636, 79751, 80875, 81999, 82124, 83248, 84363, 85487, 86512, 87636, 88751, 89875, 90999, 91124, 92248, 93363, 94487, 95512, 96636, 97751, 98875, 99999

Let's take 26875 as an example. We begin with 26 as our seed number and then proceed thus: $$ \begin{align} 26 \text{ has digit sum } 8 &\rightarrow 268 \\ 268 \text{ has digit sum } 16 \equiv 7 &\rightarrow 2687 \\ 2687 \text{ has digit sum } 23 \equiv 5 &\rightarrow 26875 \end{align} $$The three digit numbers are the same as earlier but the differences arise in the four and five digit numbers. Let's compare the previous cumulative results with the seed number 26 again but using the earlier two digit approach:$$ \begin{align} 26 \text{ has digit sum } 8 &\rightarrow 268 \\ 68 \text{ has digit sum } 14 \equiv 5 &\rightarrow 2685 \\ 85 \text{ has digit sum } 13 \equiv 4 &\rightarrow 26854 \end{align} $$