Showing posts with label multiplication. Show all posts
Showing posts with label multiplication. 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

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.

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.

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.

Thursday, 14 March 2024

Forming Equations from the Digits of a Number

There was a post that I made to my Pedagogical Posturing blog in August of 2013 before I created this mathematical blog in the second half of 2015. The title was "Forming Equations from Integer Sequences" and that title was perhaps a little misleading. At the time, I wasn't aware of the OEIS or Online Encyclopedia of Integer Sequences. What I meant was the sequence of digits that define a number. For example, today my diurnal age is 27374 and so the sequence of digits is 2, 7, 3, 7, 4. Concatenation of the digits is not allowed. Thus we cannot have 27, 3, 7, 4 for example. 

In that long ago post, I wrote:

Recently I've been using Twitter to create a daily tweet that records my "day count" (number of days I've been alive) plus its factors (if not prime) and some interesting facts about the number itself or one of its factors. Sometimes there's little to say about the number and in such cases I've found that I can usually form an equation by inserting mathematical operators between one or more of the digits. 

For example, yesterday the count was 23518 and 23 - 5 = 18. Today the count is 23519 and 2 + 3 + 5 - 1 = 9. I was wondering if it's always possible to create an equation from five digits using the standard mathematical operators (addition, subtraction, multiplication, division and exponentiation in combination with brackets). Obviously with just two digits, it's only possible when the digits are repeated e.g. 99 becomes 9=9. With three digits, it's sometimes possible e.g. 819 becomes 8 + 1 = 9 but generally it isn't e.g. 219. With four digits, it's more likely e.g. 2119 becomes -2 + 11 = 9 but I'm doubtful whether this is always so. There must come a point however, where the number of digits is sufficient to ensure that it's always so. Maybe five digits is that point.

From now on, I'll try each day to form an equation to test out this theory. For example, tomorrow the count is 23520 which becomes 2 + 3 - 5 = 2 x 0 and it works for tomorrow but beyond that let's see.

Needless to say I didn't "try each day to form an equation to test out this theory" but it might be time to give it a go. The 27374 of my diurnal age today is an easy one:$$2 \times 7 -3=7+4$$However, yesterday's number, 27373, doesn't prove so easy. It seems that having two 3's and two 7's in the number makes things difficult. The conditions that I imposed in the original blog post were the use of only the standard mathematical operators of addition, subtraction, multiplication, division and exponentiation in combination with brackets. These operators needed to be applied to the digits in the order in which they occurred.

One modification that I will make here is to allow \(x \, | \,y\) meaning \(x\) is divided into \(y\) as opposed to \(x/y\) meaning \(x\) is divided by \(y\). This seems quite reasonable as it still only involves the operation of division but allows more flexibility. Its application doesn't seem to help in the case of 27373. If we allow the operator \(x\) // \(y\) meaning return the whole number part of the dividend, then an equation is possible:$$2|(7-3)=7//3$$If we allow // then we could allow \(x\) % \( y\) meaning return the remainder as a whole number when \(x\) is divided by \(y\). Thus 7 % 3 = 1.  This might be termed modulo division.

I can't see any way to create an equation from 27373 without extending the original conditions. Even concatenation of the digits doesn't seem to help. A common symbol for concatenation is || and thus 2 || 7 = 27. However, I've stipulated that the digits are to be treated as separate so I'll adhere to that condition. The best approach is to stick to the original conditions and if a solution is not possible, then // and % can be resorted to.

In the case of 27374, there is more than one way to create an equation. Here is another way:$$ 2 \times 7 -(3+7)=4 $$So what I'll try to do is to reassert my original goal of trying each day to form an equation and see what patterns emerge.

This activity of forming a "digit equation" is not all that different from one of Quanta's mathematical games called "Hyperjumps". See Figure 1.


Figure 1

Friday, 9 February 2024

Representing Numbers With Digits

My previous post focused on the number 1089 in which I made reference to a newly discovered blogging site at https://math1089.in/ and in particular to a post about the number 1089. In that post it was noted that:$$ \begin{align} 1089 &= 12 \times 3^4 + 5 \times 6 + 78 + 9\\1089 &= 987 + 65 + 4 + 32 + 1 \end{align}$$In another post about the number 108, it was noted that:$$ \begin{align} 108 &= 1 + 2 + 3 + 4 + 5 + 6 + 78 + 9\\108 &= 9 + 8 \times 7 + 6 \times 5 + 4 \times 3 + 2 ‒ 1 \end{align}$$This got me thinking about whether it was possible to represent every number at least once in terms of consecutive single or concatenated digits separated by the basic operations of arithmetic combined with exponentiation and brackets.

For example, my diurnal age today is 27339. Is such a feat possible for this number? The determination is not easy because there are just  so many possible ways to combine the digits from 1 to 9. I spent quite some time playing around with the possibilities and I did come close but not close enough. The exercise is oddly addictive. There's no serious mathematics involved in the exploration. It's more in the nature of a puzzle, like Sudoku. 

There are a variety of strategies, one of which is to establish base points with as few digits as possible. An example of this is:$$35016=1+2+3+4+5+6^7/8+9$$Here the digits 6, 7 and 8 combine to form 34992 and the remaining digits are free to be manipulated. It's true that we can use 34567 to get to a similar number but here five digits are tied up and there's little that can be done with the remaining digits (1, 2 and 8, 9) since they are separated. Here is an example of how we can get close to 27339 using the earlier mentioned base point:$$28084=-(12^3 \times 4+5)+6^7/8+9$$Another approach is to use factors. We know that 27339 = 3 x 13 x 701 and it's easy enough to create the first two factors using 1 + 2 = 3 and 3 x 4 - 5 + 6 = 13. However, we are then left with 789:$$ \begin{align} 27339 &=3 \times 13 \times 701\\30771 &= (1+2) \times (3 \times 4 - 5 +6) \times 789\\ &=3 \times 13 \times 789 \end{align}$$While this works fine for 30771, it's not of much use for 27339. In general, this approach is quite restrictive and the more promising approaches will involve additions and subtractions along with exponentiation, multiplication and division.

At the moment I don't have a solution to the specific problem of representing 27339 in terms of sequential digits and I certainly don't have an answer to the general problem of whether such a representation is always possible or only sometimes possible. Certainly there's an upper limit on the number size and this is imposed by the nine digit restriction but such a limit is huge and my investigation is focusing on numbers in the region of 30000. My suspicion is that it's not always possible within the restrictions imposed. If we relax the requirement that the digits need to be in sequential order or we allows square roots, factorials etc. then maybe it's possible but for the moment I'll keep within the earlier rules and keep revisiting the problem from time to time.

Thursday, 8 October 2020

Forming Equations from Integers


Read on!

Once upon a time, before I started this exclusively mathematical blog in 2015, I used to post occasional mathematical content to my Pedagogical Posturing blog at https://voodoo-guru.blogspot.com. I was looking back at some of these posts and noticed this one, from Saturday, 24 August 2013, titled Forming Equations from Integer Sequences. It's only short so I'll quote it in full:

Recently I've been using Twitter to create a daily tweet that records my "day count" (number of days I've been alive) plus its factors (if not prime) and some interesting facts about the number itself or one of its factors. Sometimes there's little to say about the number and in such cases I've found that I can usually form an equation by inserting mathematical operators between one or more of the digits. 

For example, yesterday the count was \(23518\) and \(23 - 5 = 18.\) Today the count is \(23519\) and \(2 + 3 + 5 - 1 = 9\). I was wondering if it's always possible to create an equation from five digits using the standard mathematical operators (addition, subtraction, multiplication, division and exponentiation in combination with brackets). Obviously with just two digits, it's only possible when the digits are repeated e.g. \(99\) becomes \(9 = 9\). With three digits, it's sometimes possible e.g. \(819\) becomes \(8 + 1 = 9\) but generally it isn't e.g. \(219\). With four digits, it's more possible e.g. \(2119\) becomes \(-2 + 11 = 9\) but I'm doubtful whether this is always so. There must come a point however, where the number of digits is sufficient to ensure that it's always so. Maybe five digits is that point.

From now on, I'll try each day to form an equation to test out this theory. For example, tomorrow the count is \(23520\) which becomes \(2+3-5=2 \times 0 \) and it works for tomorrow but beyond that let's see.

Well, I didn't keep my promise of trying to form an equation each day from the digits making up my diurnal age. I have however, written about selfie numbers in a post of Friday, 27th March 2020 to my Mathematical Meanderings blog site. These are somewhat similar in spirit. In that post, I also mention Friedman numbers that can be described as follows:

Consider \(28547 =(8+5)^4−(7 \times 2)\) expressed in base 10, both sides use the same digits. An integer is a Friedman number if it can be put into an equation such that both sides use the same digits but the right hand side has one or more basic arithmetic operators (addition, subtraction, multiplication, division, exponentiation) interspersed. Brackets, as usual, are essential to clarify the order of operations. These numbers are named after Erich Friedman, Assoc. Professor of Mathematics at Stetson University. With the help of his students he has researched Friedman numbers in bases 2 through 10 and even with Roman numerals. When both sides use the digits in the same order, the number is called a ”nice” or ”strong” Friedman number. For example, \( 3125=(3+[1\times2])^5.\)

My approach is similar to this except I'm trying to create an equation from the digits (using them in the same order as they appear in the number). As another example, today I'm \(26121\) days old and this is an easy one because \( (2 \times 6)/12=1 \) if we allow concatenation of digits. If only individual digits are allowed, then \(-(2-6)=1+2+1 \) satisfies. It's probably better to use the individual digits as is done with the Friedman numbers. I'll try to include this as part of my daily number analysis. 

Going back a few days, we have:

  • \(26120 \text{ --> } 2 = \frac{6}{1 + 2 +0} \)
  • \(26119 \text{ --> } 2 + 6 \times 1 = -1 + 9 \)
  • \(26118 \text{ --> } 2 + 6 + 1 = 1 + 8 \)
  • \(26117 \text{ --> } 2 + 6 = 1 \times 1 + 7 \)
  • \(26116 \text{ --> } 2 + 6 = 1 + 1 + 6 \)
  • \(26115 \text{ --> } -2 + 6 + 1 \times 1 = 5 \)
  • \(26114 \text{ --> } -2 + 6 = 1 - 1 + 4 \)
  • \(26113 \text{ --> } -2 + 6 = 1 \times 1 + 3 \)
  • \(26112 \text{ --> } -2 + 6 = 1 + 1 + 2 \)
  • \(26111 \text{ --> } 2 = \frac{6}{1+1+1}\)
  • \(26110 \text{ --> } 2 \times 6 \times (1-1) = 0 \)
It seems that it's always possible to form an equation using only brackets and the basic arithmetic operators of addition, subtraction, multiplication, division and exponentiation. Perhaps even the exponentiation is not needed, as the examples above show. Let's see if this assumption holds true for future numbers. This is hardly high level mathematics but it's a simple yet oddly satisfying activity.