Replace my twins, triplets, etc. by 1

(Dall-e creation)
(English version by Google below)
French
On choisit (ici) n = 1, lequel on multiplie par 2, puis le résultat par 2, puis le résultat par 2, etc.
Dès que l’une des itérations contient un bloc de deux ou plusieurs chiffres adjacents identiques, ce bloc est remplacé par le chiffre 1. Et on itère à nouveau.
Pour a(1) = 1 la suite F entre dans une boucle de 42 termes :

F = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 6136, 12272, 1172, 172, 344, 31, 62, 124, 248, 496, 992, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 611, 61, 122, 11, 1, 2, 4, 8, 16,...

Y a-t-il des boucles plus courtes ? Plus longues ? Certaines valeurs de a(n) n’entrent-elles jamais dans une boucle ?

Une suite intéressante S qui trouverait peut-être sa place dans lOEIS peut se développer à linfini : on remplace le premier terme de la boucle à venir par le plus petit entier absent jusque là. Litération se poursuivrait (avec 3 ici), sinterromperait avec un terme déjà présent, reprendrait avec un terme « frais », etc.

S = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 6136, 12272, 1172, 172, 344, 31, 62, 124, 248, 496, 992, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 611, 61, 122, 11, 3, 6, 5, ...

English 
We choose (here) n = 1, which we multiply by 2, then the result by 2, then the result by 2, etc.
As soon as one of the iterations contains a block of two or more identical adjacent digits, this block is replaced by the digit 1. And we iterate again.
For a(1) = 1 the sequence F enters a loop of 42 terms:

F = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 6136, 12272, 1172, 172, 344, 31, 62, 124, 248, 496, 992, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 611, 61, 122111, 2, 4, 8, 16,...

Are there shorter loops? Longer ? Do some values of a(n) never enter a loop?

An interesting sequence S which would perhaps find its place in the OEIS can be developed infinitely: we replace the first term of the loop to come by the smallest integer absent until then. The iteration would continue (with 3 here), interrupt with a term already present, resume with a “fresh” term, etc. 

S = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 6136, 12272, 1172, 172, 344, 31, 62, 124, 248, 496, 992, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 611, 61, 122, 11, 3, 6, 5, ...

____________________
Giorgos K. was quick to send this:

> Here are some remarks about your new seq:
Conjecture: 
All the loops for different a(1) have length 42 or 8 (most of the times 42).
If s is the starting point of the loop, then here are the first loops with length NOT equal to 42:

a(1)    s    length
234   1872      8
371    371      8
468   1872      8
742    742      8
873   1872      8
925    371      8
936   1872      8
947    371      8

As we can see all the lengths not equal to 42 are equal to 8. This holds for the first million values of a(1): lengths are equal to 42 or 8.
Now about the second seq, here are the first 100 terms + plot and Log-plot for the first 10000 terms:

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 6136, 12272, 1172, 172, 344, 31, 62, 124, 248, 496, 992, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 611, 61, 122, 11, 3, 6, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 655360, 61360, 122720, 11720, 1720, 3440, 310, 620, 1240, 2480, 4960, 9920, 120, 240, 480, 960, 1920, 3840, 7680, 15360, 30720, 61440, 6110, 610, 1220, 110, 7, 14, 28, 56, 112, 9, 18, 36, 72, 144, 13, 26, 52,...
Many thanks, Giorgos – what a beauty, those waves!
____________________
Next day update (Jan. 6th, 2024)

Hans Havermann:
Giorgos: "All the loops for different a(1) have length 42 or 8."

The loops come in pairs. Known so far, minimums = 1 & 10 (lengths 42); minimums = 371 & 3710 (lengths 8); minimums = 370371 & 3703710 (lengths 8).

[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 6136, 12272, 1172, 172, 344, 31, 62, 124, 248, 496, 992, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 611, 61, 122, 11, 1]

[371, 742, 1484, 2968, 5936, 11872, 1872, 3744, 371]

[370371, 740742, 1481484, 2962968, 5925936, 11851872, 1851872, 3703744, 370371]

[HH, a few time later]:
I should have been able to figure this out sooner. The 371 (3710) & 370371 (3703710) extend to length-8 loops 370370371 (3703703710), 370370370371 (3703703703710), etc.

[370370371, 740740742, 1481481484, 2962962968, 5925925936, 11851851872, 1851851872, 3703703744, 370370371]

[370370370371, 740740740742, 1481481481484, 2962962962968, 5925925925936, 11851851851872, 1851851851872, 3703703703744, 370370370371]

Eric A:
Thanks for those nice pairs, Hans!
____________________
Next update (Jan. 7th, 2024)
– a private conversation with Giorgos:

EA
Hi Giorgos,
I like a lot this idea of replacing a chunk of adjacent equal digits by 1, then multiply the result by 2 and iterate. 
We see that we can easily play with a few parameters to produce and study more variants.
1) replace the chunk by 2 (instead of 1), or 3, or 4, or ...42, or anything else;
2) replace the chunk by [the chunk + 1], or [the chunk + 2] or ... [the chunk + 42];
3) multiply the result by 3 instead of 2, or by 4, or by 5, etc.

The idea is to check if the new iterations behave like the first you spotted (loops of 8 and 42 — coming by pairs as Hans H. has found),  etc.

Here is my first try by hand — ending indeed in a 16-loop (same rules as the first ones, but multiplication by 3 instead of 2):

T = 1,3,9,27,81,243,729,2187,6561,19683,59049,177147,11147,147,441,11,(1)

Second try, a(1)=2 and multiplication by 3 again:

U = 2, 6, 18, 54, 162, 4861458, 4374, 13122, 1311, 131, 393, 1179, 179, 537, 1611, 161, 483, 1449, 119, 19, 57, 171, 513, 1539, 4617, 13851, 41553, 4113, 413, 1239, 3717, 11151, 151, 453, 1359, 4077, 401, 1203, 3609, 10827, 32481,  97443,  9713, 29139, 87417, 262251, 26151, 78453, 235359, 706077, 70601, 211803, 21803, 65409, 196227, 19617, 58851, 5151, 15453, 46359, 139077, 13901, 41703, 125109, 375327, 1125981, 125981, 377943, 31943, 95829, 287487, 862461, 2587383, 7762149, 162149, 486447, 48617, 145851, 437553, 43713, 131139, 13139, 39417, 118251, 18251, 54753, 164259, 492777, 4981, 14763, 44289, 1289, 3867, 11601, 1601, 4803, 14409, 1109, 109, 327, 981, 2943, 8829, 129, 387, 1161, 161, 48, 1449, 119, 19, 57, 171, 513, 1539, 4617, 13852, 41553, 4113, 413, 1239, 3717, 11151, 151, 453, 1359, 4077, 401, 1203, 3609, 10827, 32481, 97443, 9713, 29139, 87417, 262251, 26151, 78453, 235359, 706077, 70601, 211803, 21803, 65409, 196227, 19617, 58851, 5151, 15453, 46359, 139077, 13901, 41703, 125109, 37532, 1125981, 125891, 377943, 3193, 95829, 287487,  862461, 2587383, 7762149, 162149, 486447, 48617, etc.
— I am lost and probably on a wrong track! What do you think?

GK
Let's start from the end...
Your sequence U should have stopped at the second 161...

U = 2, 6, 18, 54, 162, 486, 1458, 4374, 13122, 1311, 131, 393, 1179, 179, 537, 1611, 161, 483, 1449, 119, 19, 57, 171, 513, 1539, 4617, 13851, 41553, 4113, 413, 1239, 3717, 11151, 151, 453, 1359, 4077, 401, 1203, 3609, 10827, 32481, 97443, 9713, 29139, 87417, 262251, 26151, 78453, 235359, 706077, 70601, 211803, 21803, 65409, 196227, 19617, 58851, 5151, 15453, 46359, 139077, 13901, 41703, 125109, 375327, 1125981, 125981, 377943, 31943, 95829, 287487, 862461, 2587383, 7762149, 162149, 486447, 48617, 145851, 437553, 43713, 131139, 13139, 39417, 118251, 18251, 54753, 164259, 492777, 4921, 14763, 44289, 1289, 3867, 11601, 1601, 4803, 14409, 1109, 109, 327, 981, 2943, 8829, 129, 387, 1161, (161)
So, you have a loop of length 91.

3) Now, here are the lengths of loops of the first 100 a(1)  for different multipliers:
2-> (see seq F opening this page){42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42}

3-> (see seqs T and U above){16,91,16,91,17,91,91,31,16,16,16,91,91,91,17,16,91,91,91,91,91,16,91,31,17,91,16,16,31,16,31,91,16,91,17,91,16,91,91,91,31,91,91,16,17,91,16,16,16,17,91,91,31,91,16,16,91,91,16,91,91,91,91,91,91,16,91,91,91,91,31,31,31,16,17,91,16,91,31,31,16,91,16,16,91,91,31,16,91,16,91,91,31,91,16,91,31,91,16,16}

4->{41,41,41,41,41,41,41,41,41,41,41,41,41,3,41,41,41,41,3,41,41,41,41,41,41,3,41,41,41,41,41,41,41,41,3,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3,41,41,41,41,41,41,41,41,3,41,41,41,3,41,41,41,41,41,41,3,41,41,3,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3,41,41}

5->{867,867,401,867,867,401,401,867,401,867,867,867,867,401,401,13,867,401,401,867,867,867,401,867,867,867,401,867,867,401,867,39,867,867,401,13,867,401,401,867,13,867,401,867,401,401,401,867,401,867,867,867,867,401,867,867,867,867,401,867,867,867,401,867,867,867,401,39,867,401,867,867,867,867,401,13,867,401,401,13,39,13,401,867,867,401,401,867,401,401,13,867,867,401,401,13,867,401,867,867}

6->{147,6,147,147,147,147,6,147,147,147,147,6,147,7,147,147,28,147,7,6,147,147,7,147,7,147,85,147,147,147,147,28,147,7,147,147,147,147,7,147,147,6,147,147,85,147,28,147,147,147,147,28,147,147,147,147,28,7,147,147,147,28,147,7,7,147,28,57,147,6,147,6,147,147,147,7,147,147,147,147,147,6,147,7,147,147,147,147,147,147,7,6,147,147,28,147,6,147,147,147}

7->{39,513,513,39,71,6,39,513,39,39,39,39,6,513,6,39,39,39,39,513,513,39,39,513,6,513,39,39,513,513,39,513,39,39,71,513,39,513,39,39,39,6,39,39,6,39,39,39,39,71,39,513,513,513,39,513,39,39,39,6,39,39,39,39,39,39,513,39,59,39,513,513,39,39,6,513,39,39,6,513,59,39,59,39,39,513,39,39,513,39,6,39,39,513,6,513,513,513,39,39}

8->{18,18,18,18,18,18,18,18,90,18,18,18,18,18,18,18,90,18,18,18,90,18,18,18,90,18,18,18,90,18,18,18,18,90,18,90,18,18,90,18,18,18,18,18,90,18,18,18,18,18,18,18,18,18,18,18,90,18,90,18,18,18,90,18,18,18,90,18,18,18,18,90,18,18,18,18,18,18,90,18,18,18,18,90,18,18,90,18,18,90,18,18,18,18,18,18,18,18,18,18}

9->{119,119,13,119,29,119,119,119,119,119,119,13,119,119,155,119,119,119,119,119,119,119,119,119,155,119,13,119,119,13,119,119,119,119,155,119,119,119,119,119,13,119,119,119,29,119,119,119,119,29,119,119,13,119,119,119,119,119,119,119,119,119,119,119,155,119,119,13,119,119,119,119,119,119,194,119,119,119,119,119,119,13,119,119,155,119,119,119,119,119,119,13,119,119,119,119,119,13,119,119}

10->{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}

42->{6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,6348,1263,6348,6348,6348,1263,6348,6348,6348,6348,6348,6348,6348}

2) If we substitute the chunk with [chunk+1] the sequences seem to explode to infinity...

V = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 65636, 131272, 262544, 262545, 525090, 1050180, 2100360, 211360, 212360, 424720, 849440, 849450, 1698900, 169891, 339782, 349782, 699564, 6100564, 611564, 612564, 1225128, 1235128, 2470256, 4940512, 9881024, 9891024, 19782048, 39564096, 79128192, 158256384, 316512768, 633025536, 634025636, 1268051272, 2536102544, 2536102545, 5072205090, 5072305090, 10144610180, 10145610180, 20291220360, 20291230360, 40582460720, 81164921440, 81264921450, 162529842900, 16252984291, 32505968582...

1) Finally, if we replace the chunks with 2,3,4... instead of 1, we get loops of lengths:

—chunks replaced by 2, multiplication by 2:
{12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12} probably always 12

—chunks replaced by 2, multiplication by 3:{120,141,120,141,3,141,116,141,120,120,141,141,120,141,3,141,141,141,116,141,116,141,79,141,3,141,120,141,116,120,141,141,141,141,6,141,141,141,120,141,79,141,116,141,3,141,79,141,116,3,141,141,141,141,141,141,116,141,141,141,79,141,116,141,141,141,120,141,79,116,141,141,141,141,3,141,141,141,141,141,120,26,116,141,141,141,116,141,116,120,79,141,141,141,26,141,141,141,141,141}
etc.

—chunks replaced by 3, multiplication by 2:{14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14}

—chunks replaced by 3, multiplication by 3:{23,23,23,23,9,23,49,23,23,23,23,23,23,23,9,23,23,23,49,23,49,23,23,23,26,23,23,23,23,23,23,23,23,23,26,23,23,23,23,23,23,23,23,23,9,23,23,23,23,9,23,23,23,23,23,49,49,23,23,23,23,23,49,23,23,23,23,23,23,49,23,23,23,23,26,23,23,23,23,23,23,49,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23}
etc.
____________________
EA
Nice job, Giorgos – and fascinating results, for me: the regularity of the loops, even changing the initial conditions, is a question mark... It seems difficult to find rules producing a chaotic seq not entering a loop and not exploding too fast!
Merci, merci, merci Giorgos – the math universe is infinite and beautiful – wake up the babies!-)
____________________
Evening update:
HH
V = 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 65636, 131272, 262544, 262545, 525090, 1050180, 2100360, 211360, 212360, 424720, 849440, 849450, 1698900, 169891, 339782, 349782, 699564, 6100564, 611564, 612564, 1225128, 1235128, 2470256, 4940512, 9881024, 9891024, 19782048, 39564096, 79128192, 158256384, 316512768, 633025536, 634025636, 1268051272, 2536102544, 2536102545, 5072205090, 5072305090, 10144610180, 10145610180, 20291220360, 20291230360, 40582460720, 81164921440, 81264921450, 162529842900, 16252984291, 32505968582, ...

I like this one. And yes, while the numbers get quickly large, their eventual sizes seem to be largely confined, say (roughly) 10^15 to 10^55.
____________________
Many thanks, Hans – your definition of the confinement made my evening, I can't even read the last figures !-)
____________________
HH
Perhaps the attached graph explains it better:
EA
Waooooow, what a marvel! – and yet another mystery (the confinement)...
_____________________
Midnight update
HH
I just calculated 100 million terms of V.
A graph of the final one million terms is attached. The smallest number in this region is 40584253184307148291. The largest is 165943212508653801005149589895625087149571210050257450. The chances of running into a duplicate of integers this large is very, very small. However, eventually it will happen (there are only a finite number of even very large integers) and when it does, we will have a loop.

EA
What can I say more? 
My thanks for the very clear explanations — and my gratitude for the wonderful blue graph!
____________________
Next day update by Giorgos K.
GK
Very nice observation by Hans!

Let's consider these numbers "random".
If you think about it, you have increasing and decreasing number of digits in the following situations:
a) Increasing
    Because the number is doubled: That is everytime the starting digit is 5,6,7,8,9, When we have consecutive doublings this happens around 30% of the time.
    Also when we have 99->100 we have +1 digit but in the next step we have 00->1 and -1 digit (so this doesn't count)

b) Decreasing
     When we have 2 or more consecutive zeros
      The probability of getting consecutive zeros depends on the length of the number.
      If the number is small then the probability is small and "doubling" is winning.
      If the number is very large then we have the opposite.
      So, I computed (an approximation) of the  "sweet spot" : That is "how big must the integer be in order for it to have consecutive zeros with probability 30%"
      It turns out that this number is (approximately) 10^40. This means that above this number the zeros are winning and the digits decrease and vice versa. So, this system "fights" between these two states and we get the "zone of equilibrium". I agree with Hans that the system must reach a loop eventually. 
____________________

(Dall-e creation)

Commentaires

Posts les plus consultés de ce blog

Underline, reproduce

Beautés ?

Triples for the new year