OFFSET
0,3
COMMENTS
Conjecture: every number will eventually reach one of 0, 1, or 5.
From Chai Wah Wu, Feb 04 2019, Feb 13 2019: (Start)
Conjecture is true for n < 10^10.
1604466 takes 115 steps to reach 5 and is the largest value for a(n) for n < 10^7.
91070713 takes 121 steps to reach 5 and is the largest value for a(n) for n < 10^8.
126591463 and 801282051 both take 128 steps to reach 5 and this is the largest value for a(n) for n < 10^9.
The numbers 1582393271, 1582393293, 4645106705 all take 131 steps to reach 5 and this is the largest value for a(n) for n < 10^10.
(End)
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..10000
EXAMPLE
Starting with 2, the trajectory is 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 636, 1272, 25, 50, 1, reaching 1 in 20 steps, so a(2) = 20.
3 reaches 1 in 12 steps: 3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 61, 1, so a(3) = 12.
10 reaches 5 in 19 steps: 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 6360, 12720, 250, 5, so a(10) = 19.
PROG
(Python)
from re import split
def A321801(n):
return int('0'+''.join(d for d in split('(0+)|(1+)|(2+)|(3+)|(4+)|(5+)|(6+)|(7+)|(8+)|(9+)', str(n)) if d != '' and d != None and len(d) == 1))
def f(n):
x = 2*n
y = A321801(x)
while x != y:
x, y = y, A321801(y)
return x
def A323832(n):
mset, m, c = set(), n, 0
while True:
if m == 1 or m == 0 or m == 5:
return c
m = f(m)
if m in mset:
return -1
mset.add(m)
c += 1 # Chai Wah Wu, Feb 04 2019, Feb 11 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Feb 03 2019
STATUS
approved