login
A370394
Number of steps to reach 0 by applying the map f(x) = 5x + 1 if x is odd and floor(x/3) if x is even, or -1 if 0 is never reached.
1
0, 3, 1, 6, 4, 4, 2, 7, 2, 12, 7, 5, 5, 10, 5, 10, 5, 15, 3, 10, 3, 15, 8, 8, 3, 8, 3, 30, 13, 8, 8, 18, 8, 13, 6, 13, 6, 6, 6, 11, 11, 11, 6, 6, 6, 28, 11, 6, 6, 33, 6, 11, 16, 11, 4, 11, 4, 21, 11, 11, 4, 9, 4, 14, 16, 9, 9, 9, 9, 21, 9, 14, 4, 14, 4, 26, 9
OFFSET
0,2
COMMENTS
Conjecture: for all n, a(n) != -1.
EXAMPLE
For n=3, the trajectory of 3 under map f is as follows and takes a(3) = 6 steps to reach 0: 3 -> 16 -> 5 -> 26 -> 8 -> 2 -> 0.
MAPLE
a:= proc(n) option remember; `if`(n=0, 0,
1+a(`if`(n::even, floor(n/3), 5*n+1)))
end:
seq(a(n), n=0..76); # Alois P. Heinz, Feb 22 2024
PROG
(Python)
def map_5x(n): return 5*n+1 if n%2 == 1 else n//3
def A370394(n):
m = n; ct = 0
while m != 0: m = map_5x(m); ct += 1
return ct
for n in range(77): print(A370394(n), end = ', ')
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Feb 17 2024
STATUS
approved