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.

No comments:

Post a Comment