Showing posts with label triple. Show all posts
Showing posts with label triple. Show all posts

Thursday, 15 October 2026

Double-Safe and Triple-Safe Primes

A safe prime \(p\) is one such that \( \dfrac{p-1}{2} \) is also prime.
The first example of such a prime is 5 because \( \dfrac{5-1}{2} =2\) which is prime.
However, we can generalise this notion and speak of a \(k\)-safe prime \(p\) where $$ \frac{p-(2^i-1)}{2^i} \text{ is prime for } i=0,1, 2, \dots  k$$Let's look at the various values of \(k\) as applied to a prime \(p\) :

  • \(i=0\) just gives the originating prime \(p\)
  • \(i=1\) means the prime is safe and  \( \dfrac{p-1}{2} \) is prime
  • \(i=2\) means the prime is 2-safe or double-safe and  \( \dfrac{p-3}{4} \) is prime
  • \(i=3\) means the prime is 3-safe or triple-safe and  \( \dfrac{p-7}{8} \) is prime

Let's look at a specific prime, 28319, that is known be a triple safe prime:

  • \(28319\) is prime
  • \(28319 \rightarrow \dfrac{28319-1}{2}  =14159\) which is thus a safe prime
  • \(28319 \rightarrow \dfrac{28319-3}{4} =7079\) which is thus a double-safe prime
  • \(28319 \rightarrow \dfrac{28319-7}{8}  =3539\) which is thus a triple-safe prime
  • \(28319 \rightarrow  \dfrac{28319-15}{16} =1769= 29 \times 61 \) which is not prime
  • These triple-safe primes form OEIS A157358 and the initial members are: 

    23, 47, 719, 1439, 2879, 4079, 9839, 11279, 21599, 28319, 51599, 84719, 92399, 95279, 96959, 137279, 157679, 159119, 178799, 209519, 219839, 243119, 349199, 429119, 430799, 441839, 462719, 481199, 491279, 507359, 533999, 571199, 597599

    As can be seen, 28319 is the last triple-safe prime that I'll see in my lifetime. The double-safe primes form OEIS A066179 and these are more frequent in the range up to 40000:

    11, 23, 47, 167, 359, 719, 1439, 2039, 2879, 4079, 4127, 4919, 5639, 5807, 5927, 6047, 7247, 7559, 7607, 7727, 9839, 10799, 11279, 13799, 13967, 14159, 15287, 15647, 20327, 21599, 21767, 23399, 24407, 24527, 25799, 28319, 28607, 29399, 31607, 35879, 36887

    What about quadruple, quintuple-safe primes and beyond. Up to 40000, there are only three quadruple-safe primes and these are 47, 1439 and 2879. Of these, only 2879 is a quintuple-safe prime (permalink). There is no sextuple-safe prime until we reach 71850239! Up to a billion, there are no septuple-safe primes.

    Thursday, 23 May 2024

    Simultaneously Inconsummate, Self and Untouchable Numbers

    Today I turn 27444 days old and one property of this number is that it is inconsummate, meaning that there is no number that divided by its sum of digits equals 27444. What I noticed however, was that 27111, 27222, 27333, 27444, 27666, 27777, 27888 and 27999 are all inconsummate. 

    Notice that 27555 is not inconsummate because 991980, when divided by its sum of digits (36), gives 27555. Similarly 27000 is not inconsummate because 243000, when divided by its sum of digits (9) gives 27000 as does 486000 when divided by its sum of digits (18) etc. The latter result is to be expected because doubling a number produces the same dividend when it is divided by the sum of digits. Similarly, tripling a number produces the same dividend and so any number that is "consummate" has an infinity of numbers that, when divided by their sum of digits, produce the number.

    The pattern is less noticeable in the range from 26000 to 26999 where only 26111, 26666 and 26888 are inconsummate. In the range from 28000 to 28999, none of the 28XXX numbers are inconsummate. In the range from 29000 to 29999, we find 29222, 29555 and 29777 to be inconsummate. So the 27000 to 27999 millenium seems to produce one of the highest counts of ABXXX numbers but whether this is the highest, I don't know. In my post titled Inconsummate Numbers from the 1st of August 2018, I provide a list of all inconsummate numbers from 62 to 65535.

    Getting back to the number associated with my diurnal age (27444) we find that it is also:

    • a self number, because there is no number that, added to its sum of digits, gives 27444
    • an untouchable number, because it is not equal to the sum of proper divisors of any number
    One might reasonably ask the question as to how many numbers are inconsummate, self and untouchable? I was able to identify all the numbers up to 40000 with this property and there are 265 of them. Here they are:

    872, 2672, 3752, 3818, 3842, 3864, 4046, 4316, 4338, 4382, 4472, 4494, 4742, 4832, 4854, 4898, 5126, 5148, 5372, 6654, 7284, 7598, 8162, 9152, 9218, 9264, 9848, 10076, 10368, 10379, 10412, 10884, 10974, 11481, 11516, 11549, 12594, 12752, 13226, 13259, 13314, 13382, 13742, 13922, 14126, 14148, 14328, 14394, 14418, 14664, 14754, 14798, 14822, 14934, 14978, 15116, 15215, 15452, 15474, 15507, 15597, 16251, 16811, 17217, 17285, 17544, 17588, 17621, 17757, 18141, 18387, 18422, 18837, 20325, 20514, 20874, 20918, 21392, 22316, 22652, 23214, 23664, 23888, 24722, 24755, 25071, 25104, 25317, 25374, 25418, 25464, 25532, 25622, 25655, 25868, 25901, 26039, 26981, 27029, 27420, 27444, 27611, 28142, 28254, 28377, 28388, 28511, 28737, 28748, 28926, 29165, 29187, 29222, 29244, 29321, 29424, 29435, 29760, 29995, 30337, 30348, 30359, 30449, 30651, 30774, 30998, 31057, 31147, 31237, 31292, 31314, 31428, 31439, 31584, 31707, 31764, 31808, 31832, 31922, 31955, 32025, 32036, 32047, 32069, 32091, 32137, 32159, 32214, 32394, 32418, 32429, 32484, 32552, 32574, 32585, 32618, 32732, 32798, 32822, 32855, 32934, 33037, 33059, 33092, 33114, 33171, 33239, 33698, 33911, 34082, 34374, 34385, 34587, 34655, 34699, 34767, 34925, 34947, 35105, 35151, 35318, 35432, 35454, 35577, 35588, 35621, 35757, 35847, 35880, 35891, 35924, 35948, 35981, 36029, 36095, 36207, 36242, 36264, 36275, 36365, 36398, 36422, 36444, 36455, 36488, 36510, 36567, 36578, 36624, 36635, 36701, 36769, 36791, 36813, 36837, 36848, 36859, 36927, 36949, 36960, 36971, 36993, 37015, 37085, 37175, 37197, 37232, 37265, 37298, 37421, 37434, 37478, 37489, 37535, 37568, 37579, 37623, 37680, 37781, 37803, 37827, 37838, 37871, 37926, 37928, 38005, 38154, 38165, 38220, 38310, 38378, 38525, 38760, 38916, 38927, 39144, 39221, 39537, 39548, 39581, 39671, 39704, 39783, 39851, 39917

    So 27444 turns out to be rather special and all such numbers are in a sense quite isolated because they cannot be derived by dividing a number by its sum of digits, nor can they be had by adding the sum of a number's digits to the number and finally they cannot be derived from the addition of the proper divisors of any number. See Bespoken for Sequences entry.

    Of the 265 numbers above, 20 of them are prime. These are 11549, 13259, 16811, 26981, 27611, 30449, 31147, 31237, 32069, 32159, 32429, 33037, 33911, 36791, 37489, 37579, 37781, 37871, 39581 and 39671. This is about the number you'd expect by chance, even if it is a little on the low side. There are 54 semiprimes. Of numbers with three consecutive digits that are the same, there are 23888, 27444, 29222, 29995 and 36444.

    Saturday, 13 January 2024

    Amicable Tuples

    When I think of amicable numbers, a pair of numbers come to mind: 220 and 284. They have the property that the sum of the proper divisors of 220 equals 284 and vice versa. This is an example of an amicable 2-tuple. The relationship between 220 and 284 can be expressed as:$$ \sigma_1(220)=\sigma_1(284)=220+284$$This means that any amicable 2-tuple, let's say \( (x, y) \), has the property that:$$ \sigma_1(x)=\sigma_1(y)=x+y $$The next amicable pair or 2-tuple is (1184, 1210). A list of numbers that form amicable pairs is given by OEIS A063990:


     A063990

    Amicable numbers.   
                                     


    The initial members are:

    220, 284, 1184, 1210, 2620, 2924, 5020, 5564, 6232, 6368, 10744, 10856, 12285, 14595, 17296, 18416, 63020, 66928, 66992, 67095, 69615, 71145, 76084, 79750, 87633, 88730, 100485, 122265, 122368, 123152, 124155, 139815, 141664, 142310

    The sequence lists the amicable numbers in increasing order. Note that the pairs \( (x, y) \) are not necessarily adjacent to each other in the list. The first time a pair ordered by its first element is not adjacent is \(x\) = 63020, \(y\) = 76084 which correspond to a(17) and a(23), respectively.

    This leads us on to amicable 3-tuples, \( (x, y,z) \), that have the property:$$ \sigma_1(x)= \sigma_1(y)= \sigma_1(z)=x+y+z$$The first amicable triple or 3-tuple is (1980, 2016, 2556). My diurnal age today, 27312, is part of the amicable 3-tuple (27312, 21168, 22200).  In general, we can call a finite set \( (x_1, x_2, \dots, x_k) \) of natural numbers (the \(x_i\) are pairwise distinct), an amicable \(k\)-tuple iff$$  \sigma_1(x_1)= \sigma_1(x_2)=\dots =\sigma_1(x_k)=x_1+x_2+...+x_k $$For \(k\)=1, the only possible amicable one-tuple is (1).

    OEIS A255215 lists numbers that belong to at least one amicable tuple and the initial members are:

    1, 220, 284, 1184, 1210, 1980, 2016, 2556, 2620, 2924, 5020, 5564, 6232, 6368, 9180, 9504, 10744, 10856, 11556, 12285, 14595, 17296, 18416, 21168, 22200, 23940, 27312, 31284, 32136, 37380, 38940, 39480, 40068, 40608, 41412, 41952, 42168, 43890, 46368, 47124

    Wednesday, 22 November 2023

    Happy Triangular Numbers

    I have to confess to treating triangular numbers with some complacency over the years. Let's recall that triangular numbers are of the form:$$ \frac{n \, (n+1)}{2} \text{ with } n \geq 1$$The first triangular numbers are:

    1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431


    Figure 1: Triangular numbers appear in Pascal's Triangle.
    In fact 3rd diagonal of Pascal's Triangle, gives all triangular numbers as shown

    Similarly I've grown rather complacent about happy numbers that have the property that repeated iterations of the sum of digits squared lead to 1. For example:$$ 27261 \rightarrow 94, 97, 130, 10, 1$$The reason that I chose 27261 is that it's the number associated with my diurnal age today.

    It turns out however, that numbers that are both triangular and happy are rather rare. These types of numbers comprise OEIS A076712 and the initial members of the sequence are:

    1, 10, 28, 91, 190, 496, 820, 946, 1128, 1275, 2080, 2211, 2485, 3321, 4278, 8128, 8256, 8778, 9591, 9730, 11476, 12090, 12880, 13203, 13366, 13530, 15753, 16471, 17205, 17578, 20910, 21115, 21321, 22791, 24753, 25651, 27261, 29890, 30135, 31626, 33670, 35245

    As can be seen, it will be quite some time before I meet the next such number: 29890. The main reason for creating this post was to draw attention to an interesting website titled Fascinating Triangular Numbers run by Shyam Sunder Gupta. It was begun on October 26th 2002 but remains active. There is a plethora of information on this site about various properties of triangular numbers so it's a wonderful resource.

    What follows are just two examples from the site:

    Example 1: The only known example of a Pythagorean triangle (\(a, b, c\)) where \(a, b, c\) are triangular numbers is (8778, 10296, 13530): $$ \begin{align} 8778^2 + 10296^2 &= 13530^2 \\ (\text{T}_{132})^2 + (\text{T}_{143})^2 &= (\text{T}_{164})^2 \end{align} $$Example 2: The only known examples of a Pythagorean triangle such that both Perimeter as well as Area are triangular numbers are: $$ \begin{align} &3312, 14091, 14475) \\ \text{with Perimeter } &= 31878 = T_{252} \\ \text{and Area } &= 23334696 = T_{6831}\\  \\&3405996, 8013265, 8707079 \\ \text{with Perimeter } &= 20126340 = T_{6344} \\ \text{and Area } &= 13646574268470 = T_{5224284} \end{align} $$

    Thursday, 4 August 2022

    Variations of Erase and Triple

    In my previous post, I looked at the traditional "erase and triple" protocol which eliminates all redundant digits in a number or, if there are none, triples the number. For example, consider 112:

    112 --> 2 --> 6 --> 18 --> 54 --> 4 --> 12 --> 1 --> 3 --> 0

    In that post, I looked at record heights and record lengths reached by numbers when this protocol is repeatedly applied. In this post, I'll propose a variation of the protocol. Instead of the erasure of repeated digits, I'll remove any prime digits (2, 3, 5 and 7). If there are no prime digits, then the number will be tripled. Let's use 112 again as an example:

    112 --> 11 --> 33 --> 0

    Let's try 66 with no prime digits and see what happens to this number:

    66 --> 198 --> 594 --> 94 --> 282 --> 8 --> 24 --> 4 -->  12 --> 1 --> 3 --> 0

    A pattern seems to be emerging. Let's test out what the record trajectory lengths are for the first 500,000 numbers (permalink):

    Erase prime digits or multiply by 3: record breakers

     1 --> 3 --> [1, 3, 0]

    4 --> 5 --> [4, 12, 1, 3, 0]

    6 --> 8 --> [6, 18, 54, 4, 12, 1, 3, 0]

    16 --> 9 --> [16, 48, 144, 432, 4, 12, 1, 3, 0]

    66 --> 12 --> [66, 198, 594, 94, 282, 8, 24, 4, 12, 1, 3, 0]

    166 --> 13 --> [166, 498, 1494, 4482, 448, 1344, 144, 432, 4, 12, 1, 3, 0]

    666 --> 16 --> [666, 1998, 5994, 994, 2982, 98, 294, 94, 282, 8, 24, 4, 12, 1, 3, 0]

    1666 --> 17 --> [1666, 4998, 14994, 44982, 4498, 13494, 1494, 4482, 448, 1344, 144, 432, 4, 12, 1, 3, 0]

    6666 --> 20 --> [6666, 19998, 59994, 9994, 29982, 998, 2994, 994, 2982, 98, 294, 94, 282, 8, 24, 4, 12, 1, 3, 0]

    16666 --> 21 --> [16666, 49998, 149994, 449982, 44998, 134994, 14994, 44982, 4498, 13494, 1494, 4482, 448, 1344, 144, 432, 4, 12, 1, 3, 0]

    66666 --> 24 --> [66666, 199998, 599994, 99994, 299982, 9998, 29994, 9994, 29982, 998, 2994, 994, 2982, 98, 294, 94, 282, 8, 24, 4, 12, 1, 3, 0]

    166666 --> 25 --> [166666, 499998, 1499994, 4499982, 449998, 1349994, 149994, 449982, 44998, 134994, 14994, 44982, 4498, 13494, 1494, 4482, 448, 1344, 144, 432, 4, 12, 1, 3, 0]

    The numbers are shown first, followed by length of their trajectories and then the trajectories themselves. It can be seen that 66 is one of record breaking numbers. Apart from 4, all the numbers contain only 1 and 6 as digits. Figure 1 shows the graph of the trajectory of 166666. 


    Figure 1: permalink

    As for record heights, it's clear that these will increase as the numbers get larger because any number not containing any prime digits will immediately be trebled. After 166666 with a trajectory length of 25, there is big gap to the next record length which is attained by 666666 with a length of 28. The trajectory is:

    666666, 1999998, 5999994, 999994, 2999982, 99998, 299994, 99994, 299982, 9998, 29994, 9994, 29982, 998, 2994, 994, 2982, 98, 294, 94, 282, 8, 24, 4, 12, 1, 3, 0

    The trajectory is shown in Figure 2 and is very similar to that of 166666 shown in Figure 1.



    Figure 2: permalink

    All the numbers that I've checked end in 0 mostly via 3 but not always. For example the trajectory of 1948 is:

    1948 --> 5844 --> 844 --> 2532 --> 0

    The end result always seems to be zero. The next thing to logically explore is what happens when we change the multiplier of the number from 3 to some other number. Let's start with 2 and work our way up from 4 to 11, showing in every case the record breakers up to 500,000.

    Erase prime digits or multiply by 2: record breakers

    1 --> 3 --> [1, 2, 0]

    4 --> 5 --> [4, 8, 16, 32, 0]

    9 --> 8 --> [9, 18, 36, 6, 12, 1, 2, 0]

    29 --> 9 --> [29, 9, 18, 36, 6, 12, 1, 2, 0]

    46 --> 10 --> [46, 92, 9, 18, 36, 6, 12, 1, 2, 0]

    49 --> 12 --> [49, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    149 --> 13 --> [149, 298, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    498 --> 16 --> [498, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    999 --> 18 --> [999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    2999 --> 19 --> [2999, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    4996 --> 20 --> [4996, 9992, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    4999 --> 22 --> [4999, 9998, 19996, 39992, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    14999 --> 23 --> [14999, 29998, 9998, 19996, 39992, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    49998 --> 26 --> [49998, 99996, 199992, 19999, 39998, 9998, 19996, 39992, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    99999 --> 28 --> [99999, 199998, 399996, 99996, 199992, 19999, 39998, 9998, 19996, 39992, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    299999 --> 29 --> [299999, 99999, 199998, 399996, 99996, 199992, 19999, 39998, 9998, 19996, 39992, 999, 1998, 3996, 996, 1992, 199, 398, 98, 196, 392, 9, 18, 36, 6, 12, 1, 2, 0]

    Erase prime digits or multiply by 4: record breakers

    1 --> 8 --> [1, 4, 16, 64, 256, 6, 24, 4]
    9 --> 9 --> [9, 36, 6, 24, 4, 16, 64, 256, 6] 
    11 --> 10 --> [11, 44, 176, 16, 64, 256, 6, 24, 4, 16]
    41 --> 12 --> [41, 164, 656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    99 --> 13 --> [99, 396, 96, 384, 84, 336, 6, 24, 4, 16, 64, 256, 6]
    101 --> 16 --> [101, 404, 1616, 6464, 25856, 86, 344, 44, 176, 16, 64, 256, 6, 24, 4, 16]
    104 --> 17 --> [104, 416, 1664, 6656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    604 --> 18 --> [604, 2416, 416, 1664, 6656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    901 --> 20 --> [901, 3604, 604, 2416, 416, 1664, 6656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    2901 --> 21 --> [2901, 901, 3604, 604, 2416, 416, 1664, 6656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    10401 --> 23 --> [10401, 41604, 166416, 665664, 66664, 266656, 6666, 26664, 6664, 26656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    41666 --> 24 --> [41666, 166664, 666656, 66666, 266664, 66664, 266656, 6666, 26664, 6664, 26656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    90104 --> 26 --> [90104, 360416, 60416, 241664, 41664, 166656, 16666, 66664, 266656, 6666, 26664, 6664, 26656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64] 
    104166 --> 27 --> [104166, 416664, 1666656, 166666, 666664, 2666656, 66666, 266664, 66664, 266656, 6666, 26664, 6664, 26656, 666, 2664, 664, 2656, 66, 264, 64, 256, 6, 24, 4, 16, 64]
    Erase prime digits or multiply by 5: record breakers

     1 --> 3 --> [1, 5, 0]

    8 --> 4 --> [8, 40, 200, 0] 
    9 --> 5 --> [9, 45, 4, 20, 0] 
    18 --> 6 --> [18, 90, 450, 40, 200, 0] 
    19 --> 7 --> [19, 95, 9, 45, 4, 20, 0
    129 --> 8 --> [129, 19, 95, 9, 45, 4, 20, 0] 
    199 --> 9 --> [199, 995, 99, 495, 49, 245, 4, 20, 0] 
    1299 --> 10 --> [1299, 199, 995, 99, 495, 49, 245, 4, 20, 0] 
    1999 --> 11 --> [1999, 9995, 999, 4995, 499, 2495, 49, 245, 4, 20, 0] 
    12999 --> 12 --> [12999, 1999, 9995, 999, 4995, 499, 2495, 49, 245, 4, 20, 0] 
    19999 --> 13 --> [19999, 99995, 9999, 49995, 4999, 24995, 499, 2495, 49, 245, 4, 20, 0] 
    129999 --> 14 --> [129999, 19999, 99995, 9999, 49995, 4999, 24995, 499, 2495, 49, 245, 4, 20, 0]
    199999 --> 15 --> [199999, 999995, 99999, 499995, 49999, 249995, 4999, 24995, 499, 2495, 49, 245, 4, 20, 0]
    Erase prime digits or multiply by 6: record breakers

    1 --> 4 --> [1, 6, 36, 6]

    8 --> 6 --> [8, 48, 288, 88, 528, 8]

    11 --> 8 --> [11, 66, 396, 96, 576, 6, 36, 6]

    18 --> 12 --> [18, 108, 648, 3888, 888, 5328, 8, 48, 288, 88, 528, 8]

    68 --> 15 --> [68, 408, 2448, 448, 2688, 688, 4128, 418, 2508, 8, 48, 288, 88, 528, 8]

    69 --> 16 --> [69, 414, 2484, 484, 2904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    144 --> 21 --> [144, 864, 5184, 184, 1104, 6624, 664, 3984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    194 --> 26 --> [194, 1164, 6984, 41904, 251424, 144, 864, 5184, 184, 1104, 6624, 664, 3984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    1199 --> 28 --> [1199, 7194, 194, 1164, 6984, 41904, 251424, 144, 864, 5184, 184, 1104, 6624, 664, 3984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    1699 --> 35 --> [1699, 10194, 61164, 366984, 66984, 401904, 2411424, 41144, 246864, 46864, 281184, 81184, 487104, 48104, 288624, 8864, 53184, 184, 1104, 6624, 664, 3984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    12699 --> 36 --> [12699, 1699, 10194, 61164, 366984, 66984, 401904, 2411424, 41144, 246864, 46864, 281184, 81184, 487104, 48104, 288624, 8864, 53184, 184, 1104, 6624, 664, 3984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    101199 --> 37 --> [101199, 607194, 60194, 361164, 61164, 366984, 66984, 401904, 2411424, 41144, 246864, 46864, 281184, 81184, 487104, 48104, 288624, 8864, 53184, 184, 1104, 6624, 664, 3984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4]

    184164 --> 38 --> [184164, 1104984, 6629904, 669904, 4019424, 401944, 2411664, 411664, 2469984, 469984, 2819904, 819904, 4919424, 491944, 2951664, 91664, 549984, 49984, 299904, 99904, 599424, 9944, 59664, 9664, 57984, 984, 5904, 904, 5424, 44, 264, 64, 384, 84, 504, 4, 24, 4] 

    Erase prime digits or multiply by 7: record breakers

    1 --> 3 --> [1, 7, 0]

    4 --> 7 --> [4, 28, 8, 56, 6, 42, 4]

    9 --> 9 --> [9, 63, 6, 42, 4, 28, 8, 56, 6]

    14 --> 13 --> [14, 98, 686, 4802, 480, 3360, 60, 420, 40, 280, 80, 560, 60]

    84 --> 14 --> [84, 588, 88, 616, 4312, 41, 287, 8, 56, 6, 42, 4, 28, 8]

    184 --> 15 --> [184, 1288, 188, 1316, 116, 812, 81, 567, 6, 42, 4, 28, 8, 56, 6]

    406 --> 16 --> [406, 2842, 84, 588, 88, 616, 4312, 41, 287, 8, 56, 6, 42, 4, 28, 8]

    988 --> 17 --> [988, 6916, 48412, 4841, 33887, 88, 616, 4312, 41, 287, 8, 56, 6, 42, 4, 28, 8]

    1404 --> 19 --> [1404, 9828, 988, 6916, 48412, 4841, 33887, 88, 616, 4312, 41, 287, 8, 56, 6, 42, 4, 28, 8]

    4164 --> 21 --> [4164, 29148, 9148, 64036, 6406, 44842, 4484, 31388, 188, 1316, 116, 812, 81, 567, 6, 42, 4, 28, 8, 56, 6]

    9964 --> 22 --> [9964, 69748, 6948, 48636, 4866, 34062, 406, 2842, 84, 588, 88, 616, 4312, 41, 287, 8, 56, 6, 42, 4, 28, 8]

    29964 --> 23 --> [29964, 9964, 69748, 6948, 48636, 4866, 34062, 406, 2842, 84, 588, 88, 616, 4312, 41, 287, 8, 56, 6, 42, 4, 28, 8]

    99144 --> 26 --> [99144, 694008, 4858056, 48806, 341642, 4164, 29148, 9148, 64036, 6406, 44842, 4484, 31388, 188, 1316, 116, 812, 81, 567, 6, 42, 4, 28, 8, 56, 6]

    299144 --> 27 --> [299144, 99144, 694008, 4858056, 48806, 341642, 4164, 29148, 9148, 64036, 6406, 44842, 4484, 31388, 188, 1316, 116, 812, 81, 567, 6, 42, 4, 28, 8, 56, 6] 

    Erase prime digits or multiply by 8: record breakers

    1 --> 5 --> [1, 8, 64, 512, 1]

    6 --> 6 --> [6, 48, 384, 84, 672, 6]

    14 --> 8 --> [14, 112, 11, 88, 704, 4, 32, 0]

    16 --> 11 --> [16, 128, 18, 144, 1152, 11, 88, 704, 4, 32, 0]

    81 --> 13 --> [81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0]

    281 --> 14 --> [281, 81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0]

    1019 --> 15 --> [1019, 8152, 81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0]

    6018 --> 16 --> [6018, 48144, 385152, 81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0]

    8001 --> 18 --> [8001, 64008, 512064, 1064, 8512, 81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0]

    16101 --> 19 --> [16101, 128808, 18808, 150464, 10464, 83712, 81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0]

    100019 --> 20 --> [100019, 800152, 8001, 64008, 512064, 1064, 8512, 81, 648, 5184, 184, 1472, 14, 112, 11, 88, 704, 4, 32, 0] 

    Erase prime digits or multiply by 9: record breakers

    1 --> 5 --> [1, 9, 81, 729, 9]

    11 --> 6 --> [11, 99, 891, 8019, 72171, 11]

    14 --> 25 --> [14, 126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    124 --> 26 --> [124, 14, 126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    198 --> 27 --> [198, 1782, 18, 162, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    666 --> 30 --> [666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    1184 --> 32 --> [1184, 10656, 1066, 9594, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    6996 --> 34 --> [6996, 62964, 6964, 62676, 666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    26996 --> 35 --> [26996, 6996, 62964, 6964, 62676, 666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    40444 --> 36 --> [40444, 363996, 6996, 62964, 6964, 62676, 666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    44916 --> 38 --> [44916, 404244, 40444, 363996, 6996, 62964, 6964, 62676, 666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    49904 --> 40 --> [49904, 449136, 44916, 404244, 40444, 363996, 6996, 62964, 6964, 62676, 666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6]

    249904 --> 41 --> [249904, 49904, 449136, 44916, 404244, 40444, 363996, 6996, 62964, 6964, 62676, 666, 5994, 994, 8946, 80514, 8014, 72126, 16, 144, 1296, 196, 1764, 164, 1476, 146, 1314, 114, 1026, 106, 954, 94, 846, 7614, 614, 5526, 6, 54, 4, 36, 6] 

    Erase prime digits or multiply by 11: record breakers

    1 --> 4 --> [1, 11, 121, 11]

    4 --> 5 --> [4, 44, 484, 5324, 4]

    8 --> 11 --> [8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    19 --> 12 --> [19, 209, 9, 99, 1089, 11979, 1199, 13189, 1189, 13079, 109, 1199]

    48 --> 13 --> [48, 528, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    68 --> 15 --> [68, 748, 48, 528, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    81 --> 20 --> [81, 891, 9801, 107811, 10811, 118921, 11891, 130801, 10801, 118811, 1306921, 10691, 117601, 11601, 127611, 1611, 17721, 11, 121, 11]

    98 --> 23 --> [98, 1078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    298 --> 24 --> [298, 98, 1078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    848 --> 25 --> [848, 9328, 98, 1078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    2848 --> 26 --> [2848, 848, 9328, 98, 1078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    4198 --> 27 --> [4198, 46178, 4618, 50798, 98, 1078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    8018 --> 32 --> [8018, 88198, 970178, 9018, 99198, 1091178, 109118, 1200298, 10098, 111078, 11108, 122188, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    14918 --> 35 --> [14918, 164098, 1805078, 18008, 198088, 2178968, 18968, 208648, 8648, 95128, 918, 10098, 111078, 11108, 122188, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    80998 --> 36 --> [80998, 890978, 89098, 980078, 98008, 1078088, 108088, 1188968, 13078648, 108648, 1195128, 11918, 131098, 11098, 122078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    81408 --> 37 --> [81408, 895488, 89488, 984368, 98468, 1083148, 108148, 1189628, 118968, 1308648, 108648, 1195128, 11918, 131098, 11098, 122078, 108, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    84088 --> 41 --> [84088, 924968, 94968, 1044648, 11491128, 1149118, 12640298, 164098, 1805078, 18008, 198088, 2178968, 18968, 208648, 8648, 95128, 918, 10098, 111078, 11108, 122188, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198]

    284088 --> 42 --> [284088, 84088, 924968, 94968, 1044648, 11491128, 1149118, 12640298, 164098, 1805078, 18008, 198088, 2178968, 18968, 208648, 8648, 95128, 918, 10098, 111078, 11108, 122188, 1188, 13068, 1068, 11748, 1148, 12628, 168, 1848, 20328, 8, 88, 968, 10648, 117128, 1118, 12298, 198, 2178, 18, 198] 

    Thus all these "variants" have trajectories that either terminate in 0 or they loop. For example, 284088 has a trajectory of length 42 and it ends in a loop (198 --> 2178 --> 18 --> 198). Figure 3 shows the trajectory of 284088:


    Figure 4: permalink

    The original erase or triple and the variants analysed in this post all have one thing in common. The starting number is decreased in some way according to a certain rule e.g. remove duplicate digits or remove prime digits. If the rule cannot be applied, then the number is increased in some way e.g. it is tripled. I briefly tested an alternative rule to tripling, specifically squaring the number, but found that the resultant numbers quickly grew without bound.

    It would be nice to find a balance between the rule that decreases the number and the rule that increases it, so that sometimes the trajectory terminates while in other cases it does not. Clearly with the erase or triple protocol, the resulting number chain quickly terminates because of a loop or a number being reached that causes a complete or almost complete collapse because all or most of its digits are repeated or all or most of its digits are prime.

    Even multiplying by a relatively large number eventually leads to a termination. For example, multiply by 99 when there are no prime digits and use 1 as the example. Here is the trajectory that consists of 238 steps and ends in a loop:

    1, 99, 9801, 970299, 9099, 900801, 89179299, 891999, 88307901, 880901, 87209199, 809199, 80110701, 8011001, 793089099, 9089099, 899820801, 89980801, 8908099299, 890809999, 88190189901, 8730828800199, 8088800199, 800791219701, 800911901, 79290278199, 9908199, 980911701, 98091101, 9711018999, 911018999, 90190880901, 8928897209199, 8988909199, 889902010701, 8899001001, 881001099099, 87219108810801, 819108810801, 81091772269299, 810916999, 80280782901, 80808901, 8000081199, 792008038701, 90080801, 8917999299, 89199999, 8830799901, 88099901, 8721890199, 81890199, 8107129701, 8101901, 802088199, 80088199, 7928731701, 98101, 9711999, 911999, 90287901, 908901, 89981199, 8908138701, 89081801, 8819098299, 881909899, 87309080001, 809080001, 80098920099, 8009890099, 792979119801, 999119801, 98912860299, 989186099, 97929423801, 9994801, 989485299, 9894899, 979595001, 999001, 98901099, 9791208801, 99108801, 9811771299, 9811199, 971308701, 910801, 90169299, 9016999, 892682901, 8968901, 887921199, 8891199, 880228701, 880801, 87199299, 819999, 81179901, 8119901, 803870199, 8080199, 799939701, 999901, 98990199, 9800029701, 98000901, 9702089199, 90089199, 8918830701, 89188001, 8829612099, 88961099, 8807148801, 880148801, 87134731299, 814199, 80605701, 806001, 79794099, 994099, 98415801, 9841801, 974338299, 94899, 9395001, 99001, 9801099, 970308801, 9008801, 891871299, 8918199, 882901701, 8890101, 880119999, 87131879901, 81189901, 8037800199, 80800199, 7999219701, 9991901, 989198199, 97930621701, 9906101, 980703999, 9800999, 970298901, 9098901, 900791199, 90091199, 8919028701, 89190801, 8829889299, 88988999, 8809910901, 872181179199, 818119199, 80993800701, 809980001, 80188020099, 8018800099, 793861209801, 986109801, 97624870299, 9648099, 955161801, 9161801, 907018299, 9001899, 891188001, 88227612099, 8861099, 877248801, 848801, 84031299, 840199, 83179701, 81901, 8108199, 802711701, 801101, 79308999, 908999, 89990901, 8909099199, 882000820701, 880008001, 87120792099, 8109099, 802800801, 80800801, 7999279299, 999999, 98999901, 9800990199, 970298029701, 90980901, 9007109199, 900109199, 89110810701, 8911081001, 882197019099, 8819019099, 873082890801, 808890801, 80080189299, 8008018999, 792793880901, 99880901, 9888209199, 988809199, 97892110701, 98911001, 9792189099, 99189099, 9819720801, 98190801, 9720889299, 9088999, 899810901, 89081279199, 890819199, 88191100701, 8819110001, 873091890099, 8091890099, 801097119801, 80109119801, 7930802860299, 908086099, 89900523801, 89900801, 8900179299, 89001999, 8811197901, 881119901, 87230870199, 8080199

    These ruminations are fertile grounds for further posts involving new rules.

    Tuesday, 2 August 2022

    Erase or Triple Protocol

    There's always something new to discover under the mathematical sun and today I encountered an interesting protocol that can be applied to numbers. It works as follows:

    The "Erase or triple" protocol describes how to transform an integer \(K\) into an integer \(L\): if \(K\) has 2 or more identical digits, erase them to get \(L\) (1201331 becomes 20); if \(K\) has no duplicate digits, triple \(K\) to get \(L\) (20 becomes 60). Some integers disappear immediately (like 11, 2002 or 1919188), other enter into a loop if you apply this protocol to the successive results. Link.

    My diurnal age today was 26784, a number that is a member of OEIS A300150: "erase or triple": list of the successive integers that produce the next "altitude" record. The initial numbers and their associated "altitude" records are as follows (the numbers are shown first in bold and records second - permalink):

    (1, 17010), (10, 65610), (23, 121743), (176, 1154736), (1760, 1283040), (2183, 1591407), (2640, 5773680), (23976, 5826168), (24056, 5845608), (26784, 6508512), (29087, 7068141), (29701, 7217343), (30715, 7463745), (31456, 7643808), (32145, 7811235)

    Thus the numbers associated with these maximum values are:

    1  10  23  176  1760  2183  2640  23976  24056  26784  29087  29701  30715  31456  32145  

     Let's take 26784 as an example. It's trajectory is as follows:

    26784, 80352, 241056, 723168, 2169504, 6508512, 60812, 182436, 547308, 1641924, 692, 2076, 6228, 68, 204, 612, 1836, 5508, 8, 24, 72, 216, 648, 1944, 19, 57, 171, 7, 21, 63, 189, 567, 1701, 70, 210, 630, 1890, 5670, 17010, 7

    Note that trajectory enters a loop once 7 is reached for the second time. The trajectory has a length of 39 steps. It's graph is shown in Figure 1:


    Figure 1: permalink

    176, from the above list of record breakers, is an example of a number that eventually reaches 0. It's trajectory is as follows:

    176, 528, 1584, 4752, 14256, 42768, 128304, 384912, 1154736, 54736, 164208, 492624, 96, 288, 2, 6, 18, 54, 162, 486, 1458, 4374, 37, 111, 0

    The graph of its trajectory is shown in Figure 2 and consists of 25 steps: 


    Figure 2: permalink

    23, from the above list of record breakers, is an example of a number that ends in an 89 loop. It's trajectory of length 21 steps is as follows:

    23, 69, 207, 621, 1863, 5589, 89, 267, 801, 2403, 7209, 21627, 167, 501, 1503, 4509, 13527, 40581, 121743, 2743, 8229, 89

    The graph of its trajectory is shown in Figure 3:


    Figure 3: permalink

    29701, from the above list of record breakers, is an example of a number that ends in a 5 loop. It's trajectory, of length 22 steps, is as follows:

    29701, 89103, 267309, 801927, 2405781, 7217343, 214, 642, 1926, 5778, 58, 174, 522, 5, 15, 45, 135, 405, 1215, 25, 75, 225, 5

    The graph of its trajectory is shown in Figure 4:


    Figure 4: permalink

    For any number, there are only four possible end results for its trajectory: either it reaches 0 or it enters a 5, 7 or 89 loop. Returning to OEIS A300150: "erase or triple": list of the successive integers that produce the next "altitude" record. The sequence is finite and has 628 terms, with a(628) = 3291768054 (pandigital); a(628) reaches the maximum possible "altitude" 29625912486.

    When dealing with trajectories, we are interested in the length of the trajectories as well as the maxima and so a reasonable question to ask is what numbers produce trajectories of record length? It turns out that these are the records up to 40,000 with numbers first in bold and trajectory lengths following (permalink):
    [(1, 29), (16, 32), (26, 35), (56, 37), (134, 39), (218, 41), (241, 45), (871, 46), (8059, 47), (14957, 48)]

    Thus the numbers associated with the record trajectory lengths are:

    1  16  26  56  134  218   241  871   8059  14957 

     The trajectory of 14957, with a trajectory length of 48, is as follows:

    14957, 44871, 871, 2613, 7839, 23517, 70551, 701, 2103, 6309, 18927, 56781, 170343, 1704, 5112, 52, 156, 468, 1404, 10, 30, 90, 270, 810, 2430, 7290, 21870, 65610, 510, 1530, 4590, 13770, 130, 390, 1170, 70, 210, 630, 1890, 5670, 17010, 7, 21, 63, 189, 567, 1701, 70

    This 70 loop is actually a part of the 7 loop as can be seen below:

    7, 21, 63, 189, 567, 1701, 70, 210, 630, 1890, 5670, 17010, 7 

    The graph of its trajectory is shown in Figure 5:


    Figure 5: permalink

    This "erase or triple" protocol could be generalised so if the digits of a number satisfy a certain criterion then they are erased to form a new number or, if the criterion is not met, the number is modified in some way. For example, suppose the number contains prime digits (2, 3, 5 or 7). If it does, then these digits are erased. If the number does not contain any prime digits, then the number is squared and 1 is added.

    Let's use 14857 as a test number. It contains the prime digits 5 and 7 so these are erased to leave 148. This number contains no prime digits so it becomes 148 x 148 + 1 = 21905. We erase the 2 and the 5 to get 190 which becomes 190 x 190 + 1 = 36101 and so on. I could continue but the trajectory under this new protocol is best dealt with by creating an appropriate algorithm (permalink).

    Using the algorithm, the trajectory turns out to have a length of 7 and is:

    14857, 148, 21905, 190, 36101, 6101, 37222202, 0

    Once 37222202 is reached and all the prime digits are erased, we are left with 0. This seems to be the fate of many numbers but not all. For example, while 6, 66 and 666 all end in 0, 6666 increases rapidly without bound. It might be better to double the number and add 1 rather than squaring it and adding 1. However, I'm digressing. This new protocol and variations thereof could serve as the basis for a future post but that's enough for this post.

    In closing, I'll just observe that protocols like these, where we are manipulating the digits of the number in some way, fall into the realm of recreational mathematics rather than serious mathematics. Not only are they specific to the number base 10 but they also ignore, in the first step, the place value of the digits and acknowledge only the face value. Nonetheless, it's fun to explore the resultant trajectories when the different protocols are applied.