Showing posts with label zeroless. Show all posts
Showing posts with label zeroless. Show all posts

Friday, 8 May 2026

Zeroless Tetranacci Numbers

In a post titled, Sequences Formed By Removing Zeros, from January 2023,  I wrote that "It's interesting to consider what happens to a sequence if a certain rule is applied but with the stipulation that any zeros arising must be removed". In that post I looked at the zeroless Fibonacci sequence that falls into a repeating loop with a confirmed period of 912. 

The zeroless Tribonacci sequence falls into a much larger repeating loop with a confirmed period of 300,056,874. It reaches this cycle at index 208,666,297. However, it is not known whether the zeroless Tetranacci sequences cycles or not but, if it does, then \(s+p > 10^{10}\) where \(s\) and \(p\) are the starting index and period of the cycle, respectively.

 
 A371916: zeroless analog of tetranacci numbers.

The initial members are:

1, 1, 1, 1, 4, 7, 13, 25, 49, 94, 181, 349, 673, 1297, 25, 2344, 4339, 85, 6793, 13561, 24778, 45217, 9349, 9295, 88639, 1525, 1888, 11347, 13399, 28159, 54793, 17698, 11449, 11299, 95239, 135685, 253672, 495895, 98491, 983743, 183181, 176131, 1441546, 278461, 279319, 2175457

Figure 1 shows a plot of the first 100 terms:


Figure 1: permalink

Like the zeroless Fibonacci and Tribonacci sequences the ratio between successive terms of the zeroless Tetranacci sequence never approaches a limit. With no suppression of zeros, the following are the convergences:

  • Fibonacci: $\phi = \frac{1+\sqrt{5}}{2} \text{ which is }\approx 1.61803$
  • Tribonacci: the real root of $x^3 - x^2 - x - 1 = 0 \text{ which is } \approx 1.83929$
  • Tetranacci: the real root of $x^4 - x^3 - x^2 - x - 1 = 0 \text{ which is }\approx 1.92756$

Monday, 28 October 2024

Number + SOD - POD Sequences

In this post, I will be using SOD as meaning the Sum Of Digits of a number and POD as meaning the Product Of Digits of a number. Consider a number like 27602 that is the number associated with my diurnal age today. What happens if I repeatedly add the sum of its digits and subtract the product of its digits? Because it contains the digit zero, its POD is initially 0 but this soon changes as I repeat the process. Here is the 27602's trajectory that consists of 26 steps (permalink):

276002, 276019, 276044, 276067, 276095, 276124, 275474, 267663, 258621, 257685, 240918, 240942, 240963, 240987, 241017, 241032, 241044, 241059, 241080, 241095, 241116, 241083, 241101, 241110, 241119, 241065, 241083

As can be seen, a loop is reached. What about 27610? Its trajectory consists of 27 steps (permalink):

27610, 27626, 26641, 26372, 25888, 20799, 20826, 20844, 20862, 20880, 20898, 20925, 20943, 20961, 20979, 21006, 21015, 21024, 21033, 21042, 21051, 21060, 21069, 21087, 21105, 21114, 21115

There is no loop here so why does the sequence terminate with 21115. The answer is that this number has a SOD (2 + 1 + 1 + 1 + 5 = 10) equal to its POD (2 x 1 x 1 x 1 x 5 = 10). So for every number, the corresponding sequence will have a finite number of steps ending in either a loop or a number with SOD = POD. 

What's of interest now are the progressive record lengths of the sequences as we consider larger and larger numbers. Table 1 shows the record lengths up to 110,000. 

Around 10,000 it can be seen that there is a big jump from 39 (9541) to 85 (9980) and again aroud 100,000 there is an even bigger jump from 98 (98907) to 631 (99970). If I were to continue there would be another big jump around one million. The sequence of numbers with record lengths is:

1, 10, 400, 417, 432, 482, 730, 2200, 2217, 2232, 2282, 2800, 2903, 3610, 4601, 5177, 6821, 7248, 9380, 9541, 9980, 9990, 10002, 98907, 99970, 99980, 99990, 100008

This sequence is not listed in the OEIS and I certainly won't be proposing it for inclusion. Variations on this theme are of course possible. For example, the product of digits could exclude the digit 0. This digit makes no difference to the sum of a number's digits but it has the effect of always sending the product of its digits to zero.

This makes a big difference to the sequence of record lengths and we no longer get those big jumps around 10,000, 100,000 and 1,000,000. Firstly though, let's go back to the original number 27601 and see how its trajectory is affected. The new trajectory is:

27601, 27533, 26923, 26297, 24811, 24763, 23777, 21745, 21484, 21247, 21151

The initial product of digits is now not zero but 2 x 7 x 6 x 1 = 84. The sum of its digits is still 16 but the SOD - POD now becomes 16 - 84 = -68 and so the next number in the sequence is 27533. The sequence ends with 21151 which has its SOD = POD.

The record lengths are shown in Table 2.


Table 2

The sequence of numbers with record lengths with zero not counting in the POD is now as follows:

1, 11, 100, 810, 1918, 1931, 2614, 2831, 2905, 3149, 3226, 3638, 3943, 4116, 4228, 4290, 4543, 6242, 7504, 7600, 7730, 8152, 8405, 9714, 19911, 23191, 23318, 23470, 25364, 27001, 29270, 44573, 45552, 46680, 47163, 47730, 49434, 54181, 54641, 55418, 56100, 57135, 71620, 73191, 73302, 74620, 75210, 78543, 81200, 82452, 83292, 87294, 88803, 95900, 97630, 98180, 100000, 100002

On the subject of numbers from 10 up to 100,000 in which SOD = POD, it is only these combination of digits that satisfy (permalink):

[2, 2], [1, 2, 3], [1, 1, 2, 4], [1, 1, 1, 2, 5], [1, 1, 1, 3, 3], [1, 1, 2, 2, 2]

There are 68 numbers in the range from 1 to 100,000 that satisfy SOD = POD and they are:

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 123, 132, 213, 231, 312, 321, 1124, 1142, 1214, 1241, 1412, 1421, 2114, 2141, 2411, 4112, 4121, 4211, 11125, 11133, 11152, 11215, 11222, 11251, 11313, 11331, 11512, 11521, 12115, 12122, 12151, 12212, 12221, 12511, 13113, 13131, 13311, 15112, 15121, 15211, 21115, 21122, 21151, 21212, 21221, 21511, 22112, 22121, 22211, 25111, 31113, 31131, 31311, 33111, 51112, 51121, 51211, 52111

However, if we don't include zero in the product of digits then there are 164 numbers that qualify because we can insert zeros into all the above numbers with impunity. Of course this means that some numbers will exceed 100,000 and so will not be included in the list below (permalink).

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 22, 30, 40, 50, 60, 70, 80, 90, 123, 132, 202, 213, 220, 231, 312, 321, 1023, 1032, 1124, 1142, 1203, 1214, 1230, 1241, 1302, 1320, 1412, 1421, 2013, 2020, 2031, 2103, 2114, 2130, 2141, 2301, 2310, 2411, 3012, 3021, 3102, 3120, 3201, 3210, 4112, 4121, 4211, 10124, 10142, 10203, 10214, 10230, 10241, 10302, 10320, 10412, 10421, 11024, 11042, 11125, 11133, 11152, 11204, 11215, 11222, 11240, 11251, 11313, 11331, 11402, 11420, 11512, 11521, 12014, 12030, 12041, 12104, 12115, 12122, 12140, 12151, 12212, 12221, 12401, 12410, 12511, 13020, 13113, 13131, 13311, 14012, 14021, 14102, 14120, 14201, 14210, 15112, 15121, 15211, 20103, 20114, 20130, 20141, 20301, 20310, 20411, 21014, 21030, 21041, 21104, 21115, 21122, 21140, 21151, 21212, 21221, 21401, 21410, 21511, 22112, 22121, 22211, 23010, 24011, 24101, 24110, 25111, 30102, 30120, 30201, 30210, 31020, 31113, 31131, 31311, 32010, 33111, 40112, 40121, 40211, 41012, 41021, 41102, 41120, 41201, 41210, 42011, 42101, 42110, 51112, 51121, 51211, 52111

If we try reversing the order of the subtraction so that we have number + POD - SOD, the POD soon causes the sequences for many numbers to increase without bound. In the case of POD with zeros counted, the number 23 was the first to exceed a sequence length of 700. When zeros were not counted, 516 was the first number to exceed 700. 

Tuesday, 10 January 2023

Sequences Formed By Removing Zeros

It's interesting to consider what happens to a sequence if a certain rule is applied but with the stipulation that any zeros arising must be removed. If we start with 1, double it and then double the result and continue this process, we end up with an infinite sequence:

1, 2, 4, 6, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, ...

But what happens once any zeros that arise are removed? Well, nothing until 1024 is reached and it becomes 124, then 248, 496 etc. It turns out that the sequence enters a loop (marked in blue below) that has a period of 36. The minimum value within the loop is 28714 and the largest is 11,772,544. The maximum value reached overall is 765,257,552.

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 124, 248, 496, 992, 1984, 3968, 7936, 15872, 31744, 63488, 126976, 253952, 5794, 11588, 23176, 46352, 9274, 18548, 3796, 7592, 15184, 3368, 6736, 13472, 26944, 53888, 17776, 35552, 7114, 14228, 28456, 56912, 113824, 227648, 455296, 91592, 183184, 366368, 732736, 1465472, 293944, 587888, 1175776, 2351552, 47314, 94628, 189256, 378512, 75724, 151448, 32896, 65792, 131584, 263168, 526336, 152672, 35344, 7688, 15376, 3752, 754, 158, 316, 632, 1264, 2528, 556, 1112, 2224, 4448, 8896, 17792, 35584, 71168, 142336, 284672, 569344, 1138688, 2277376, 4554752, 91954, 18398, 36796, 73592, 147184, 294368, 588736, 1177472, 2354944, 479888, 959776, 1919552, 383914, 767828, 1535656, 371312, 742624, 1485248, 297496, 594992, 1189984, 2379968, 4759936, 9519872, 1939744, 3879488, 7758976, 15517952, 313594, 627188, 1254376, 258752, 51754, 1358, 2716, 5432, 1864, 3728, 7456, 14912, 29824, 59648, 119296, 238592, 477184, 954368, 198736, 397472, 794944, 1589888, 3179776, 6359552, 1271914, 2543828, 587656, 1175312, 235624, 471248, 942496, 1884992, 3769984, 7539968, 1579936, 3159872, 6319744, 12639488, 25278976, 5557952, 1111594, 2223188, 4446376, 8892752, 1778554, 355718, 711436, 1422872, 2845744, 5691488, 11382976, 22765952, 4553194, 916388, 1832776, 3665552, 733114, 1466228, 2932456, 5864912, 11729824, 23459648, 46919296, 93838592, 187677184, 375354368, 7578736, 15157472, 3314944, 6629888, 13259776, 26519552, 533914, 167828, 335656, 671312, 1342624, 2685248, 537496, 174992, 349984, 699968, 1399936, 2799872, 5599744, 11199488, 22398976, 44797952, 8959594, 17919188, 35838376, 71676752, 14335354, 286778, 573556, 1147112, 2294224, 4588448, 9176896, 18353792, 3677584, 7355168, 1471336, 2942672, 5885344, 1177688, 2355376, 471752, 94354, 18878, 37756, 75512, 15124, 3248, 6496, 12992, 25984, 51968, 13936, 27872, 55744, 111488, 222976, 445952, 89194, 178388, 356776, 713552, 142714, 285428, 57856, 115712, 231424, 462848, 925696, 1851392, 372784, 745568, 1491136, 2982272, 5964544, 1192988, 2385976, 4771952, 954394, 198788, 397576, 795152, 15934, 31868, 63736, 127472, 254944, 59888, 119776, 239552, 47914, 95828, 191656, 383312, 766624, 1533248, 366496, 732992, 1465984, 2931968, 5863936, 11727872, 23455744, 46911488, 93822976, 187645952, 37529194, 7558388, 15116776, 3233552, 646714, 1293428, 2586856, 5173712, 1347424, 2694848, 5389696, 1779392, 3558784, 7117568, 14235136, 2847272, 5694544, 1138988, 2277976, 4555952, 911194, 1822388, 3644776, 7289552, 1457914, 2915828, 5831656, 11663312, 23326624, 46653248, 9336496, 18672992, 37345984, 74691968, 149383936, 298767872, 597535744, 119571488, 239142976, 478285952, 95657194, 191314388, 382628776, 765257552, 15351514, 37328, 74656, 149312, 298624, 597248, 1194496, 2388992, 4777984, 9555968, 19111936, 38223872, 76447744, 152895488, 3579976, 7159952, 1431994, 2863988, 5727976, 11455952, 2291194, 4582388, 9164776, 18329552, 3665914, 7331828, 14663656, 29327312, 58654624, 11739248, 23478496, 46956992, 93913984, 187827968, 375655936, 751311872, 152623744, 35247488, 7494976, 14989952, 2997994, 5995988, 11991976, 23983952, 4796794, 9593588, 19187176, 38374352, 7674874, 15349748, 3699496, 7398992, 14797984, 29595968, 59191936, 118383872, 236767744, 473535488, 9477976, 18955952, 3791194, 7582388, 15164776, 3329552, 665914, 1331828, 2663656, 5327312, 1654624, 339248, 678496, 1356992, 2713984, 5427968, 1855936, 3711872, 7423744, 14847488, 29694976, 59389952, 11877994, 23755988, 47511976, 9523952, 194794, 389588, 779176, 1558352, 311674, 623348, 1246696, 2493392, 4986784, 9973568, 19947136, 39894272, 79788544, 15957788, 31915576, 63831152, 12766234, 25532468, 5164936, 1329872, 2659744, 5319488, 1638976, 3277952, 655594, 1311188, 2622376, 5244752, 148954, 29798, 59596, 119192, 238384, 476768, 953536, 19772, 39544, 7988, 15976, 31952, 6394, 12788, 25576, 51152, 1234, 2468, 4936, 9872, 19744, 39488, 78976, 157952, 31594, 63188, 126376, 252752, 5554, 1118, 2236, 4472, 8944, 17888, 35776, 71552, 14314, 28628, 57256, 114512, 22924, 45848, 91696, 183392, 366784, 733568, 1467136, 2934272, 5868544, 1173788, 2347576, 4695152, 93934, 187868, 375736, 751472, 152944, 35888, 71776, 143552, 28714, 57428, 114856, 229712, 459424, 918848, 1837696, 3675392, 735784, 1471568, 2943136, 5886272, 11772544, 2354588, 479176, 958352, 191674, 383348, 766696, 1533392, 366784

This sequence is in fact OEIS  A242350:


 A242350

Multiply a(n-1) by 2 and drop all 0's where a(0)=1.                                   


Figure 1 shows a graph of the sequence with a logarithmic scale for the y axis.


Figure 1: permalink

It doesn't matter what the starting point, the sequence will cycle sooner or later. If the starting point is 3 then the cycle begins with 479712 at the 207th term and returns to this number on the 387th term. The largest value reached overall is 582,269,952. Figure 2 shows the graph of the sequence using a logarithmic scale for the y axis.


Figure 2: permalink

The pattern in Figure 2 is very similar to that in Figure 1. The removal of zeroes, when they occur, brings the size of the number down, often drastically. The logarithmic scale gives a false sense of the magnitude of these ups and downs. Figure 3 shows the data without the logarithmic scale for the starting value of 3.


Figure 3: permalink

The same thing can be done with the Fibonacci sequence and again a cycle is reached. The 26th term is 7841 and this number is reached again at the 434th term. I won't list all the terms, just those up to 7841 (permalink):

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 61, 438, 499, 937, 1436, 2373, 389, 2762, 3151, 5913, 964, 6877, 7841, ...

Notice how 233 + 377 = 610 --> 61 and 3151 + 5913 = 9064 --> 964 in the sequence above.

These numbers form OEIS A243063:


 A243063

Numbers generated by a Fibonacci-like sequence in which zeros are suppressed.



Another example is provided by OEIS A256227:

 
 A256227

Naught-y numbers (A011540) that after removing all zeros become zeroless primes (A038618).



The initial members of the sequence (up to 1000) are (permalink):

20, 30, 50, 70, 101, 103, 107, 109, 110, 130, 170, 190, 200, 203, 209, 230, 290, 300, 301, 307, 310, 370, 401, 403, 407, 410, 430, 470, 500, 503, 509, 530, 590, 601, 607, 610, 670, 700, 701, 703, 709, 710, 730, 790, 803, 809, 830, 890, 907, 970

This sequence of course is infinite. Up to one million, there are 45304 terms or about 4.5% of the numbers in the range. That's enough for the time being.

Friday, 23 July 2021

Pandigital Numbers Formed From Squares

As the natural numbers become larger, it's more and more likely that they will contain all of the digits from 1 to 9 at least once. This is why the sequence of numbers containing all the digits from 1 to 9 is said to have an asymptotic density of 1. This is OEIS A294661:


 A294661



Numbers whose square contains all of the digits 1 through 9.   


The sequence begins:
11826, 12363, 12543, 14676, 15681, 15963, 18072, 19023, 19377, 19569, 19629, 20316, 22887, 23019, 23178, 23439, 24237, 24276, 24441, 24807, 25059, 25572, 25941, 26409, 26733, 27129, 27273, 29034, 29106, 30384, 32043, 32286, 33144, 34273, 35172, 35337, 35713, 35756, 35757, 35772, 35846, 35853, ...

I've marked the first thirty members of this sequence in blue because these numbers constitute OEIS A071519:


 A071519

Numbers whose square is a zeroless pandigital number (i.e., use the digits 1 through 9 once).


Beyond 30384 (the 30th and last member of OEIS A071519), some of the digits occur more than once or a zero appears. For example: $$32043^2=1026753849 \text{ and a zero appears}$$There are 362,880 ways of arranging of the digits from 1 to 9 (factorial 9 or 9!). However, only 30 of the resulting numbers are perfect squares and these are listed in OEIS A071519. None of them are prime.

Numbermatics representation of 26409

Today my diurnal age is 26409 and this number is a member of OEIS A071519, which is what drew my attention to the number's property:


If we allow zero and consider possible permutations of the digits from 0 to 9, there are 3,265,920 possibilities (9 x 9!) but only 87 are perfect squares and again, none are prime. All are divisible by 9. These 87 numbers form OEIS A156977:


 A156977

Numbers \(n\) such that \(n^2\) contains every decimal digit exactly once. 


The numbers are:
32043, 32286, 33144, 35172, 35337, 35757, 35853, 37176, 37905, 38772, 39147, 39336, 40545, 42744, 43902, 44016, 45567, 45624, 46587, 48852, 49314, 49353, 50706, 53976, 54918, 55446, 55524, 55581, 55626, 56532, 57321, 58413, 58455, 58554, 59403, 60984, 61575, 61866, 62679, 62961, 63051, 63129, 65634, 65637, 66105, 66276, 67677, 68763, 68781, 69513, 71433, 72621, 75759, 76047, 76182, 77346, 78072, 78453, 80361, 80445, 81222, 81945, 83919, 84648, 85353, 85743, 85803, 86073, 87639, 88623, 89079, 89145, 89355, 89523, 90144, 90153, 90198, 91248, 91605, 92214, 94695, 95154, 96702, 97779, 98055, 98802, 99066

On July 9th 2018, I wrote about Pandigital Numbers Formed From the Product of a Number and its Reversal.