Does this sequence reach infinity?

Let $$n=d_m...d_2d_1$$ where $$d_i$$ is digit of $$n$$ .

Define function $$F(n)$$, If there are any digits of $$n$$ being repeated consecutively, they convert those digits to that digit and generate new number.

Example: $$F(10225)=1025$$ because 2 repeat itself

$$F(10000)=10$$, $$F(223335300)=23530$$, $$F(23)=23$$.

Define recurrence relation $$a_k= F(2\cdot a_{k-1})$$ for $$k\ge 1$$ and $$a_0=1$$

$$\{a_0,a_1,a_2,...\}=\{1 , 2 , 4 , 8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,6536,13072,2614,528,1056,212,424,848,1696,392,784,1568,3136,6272,1254,2508,5016,1032,2064,4128,8256,16512,3024,6048,12096,24192,48384,96768,19356,387072,...\}$$

Problem: Does above sequence will ends with loop or is it approaches to infinity?

Generalization of this problem posted by Vepir : Can we reach infinity if we remove repeating digits from $a_k=m\cdot a_{k-1}$?

I haven't finished programming. It is very possible that you will get some loop. Thanks

• Interesting question ... Sep 29, 2020 at 10:35
• For the record this is not in the OEIS. Sep 29, 2020 at 10:39
• +1 Pretty interesting question. Even if it does get stuck in a loop another interesting question would be if there exists some $m$ such that $a_k=F(m.a_{k-1})$ never gets stuck in a loop. Sep 29, 2020 at 10:52
• @Peter maybe we can prove that no such $m$ exits. Sep 29, 2020 at 11:39
• @Peter Nevermind, I misread the generalization, I had set $a_0 = 17$... Sep 29, 2020 at 12:30

No, this quite quickly gets stuck in a loop. The term $$a_{68} = 16 = a_4$$.

Here's a quick python3 script that, given a starting value $$a_0$$, runs until it finds a loop in the sequence. Try it here.

def remove_repetitions(num):
new_string = ''
for index, character in enumerate(str(num)):
if index == 0:
new_string += character
else:
if character != str(num)[index-1]:
new_string += character
return int(new_string)

def fn(num):
return remove_repetitions(2*num)

ind = 0
num = 1
print(ind, num)
unique_numbers = [num]

while True:
ind += 1
num = fn(num)
print(ind, num)
if num in unique_numbers:
print('Found loop')
break
else:
unique_numbers.append(num)


Here's a list of the first 70 elements of the sequence in the form $$(n, a_n)$$

[(0, 1), (1, 2), (2, 4), (3, 8), (4, 16), (5, 32), (6, 64), (7, 128), (8, 256), (9, 512), (10, 1024), (11, 2048), (12, 4096), (13, 8192), (14, 16384), (15, 32768), (16, 6536), (17, 13072), (18, 2614), (19, 528), (20, 1056), (21, 212), (22, 424), (23, 848), (24, 1696), (25, 392), (26, 784), (27, 1568), (28, 3136), (29, 6272), (30, 1254), (31, 2508), (32, 5016), (33, 1032), (34, 2064), (35, 4128), (36, 8256), (37, 16512), (38, 3024), (39, 6048), (40, 12096), (41, 24192), (42, 48384), (43, 96768), (44, 193536), (45, 387072), (46, 7414), (47, 14828), (48, 29656), (49, 59312), (50, 18624), (51, 37248), (52, 7496), (53, 1492), (54, 2984), (55, 5968), (56, 1936), (57, 3872), (58, 74), (59, 148), (60, 296), (61, 592), (62, 184), (63, 368), (64, 736), (65, 1472), (66, 294), (67, 58), (68, 16), (69, 32), (70, 64)]

• @Mathphile Thanks for the edit! Sep 29, 2020 at 11:12
• An output-list , directly posted , would be nice. Sep 29, 2020 at 11:21
• @Peter Ok, added this. Sep 29, 2020 at 11:35
• @Vepir Can you check the sequence with $m=17$ ? Where does it loop ? Sep 29, 2020 at 12:17
• @Peter do you mean $a_k=F(17\cdot a_{k-1})$ with $a_0=1$ ? I get $a_k=(k,a)$ loop at: (59304, 3656501)=(49512, 3656501). Sep 29, 2020 at 12:28