login
A359255
Number of steps to reach a maximum starting with n in the map x->A359194(x) (binary complement of 3n), or -1 if n goes to infinity.
6
0, 0, 0, 7, 8, 0, 6, 1, 2, 9, 0, 15, 28, 5, 1, 11, 12, 29, 10, 7, 8, 0, 2, 31, 4, 21, 5, 27, 2962, 1, 14, 23, 24, 2963, 22, 3, 8, 13, 6, 0, 0, 9, 0, 2961, 2, 33, 26, 11, 74, 4, 1591, 69, 20, 5, 3, 3, 34, 9, 30, 1, 16, 1, 76, 11
OFFSET
0,4
COMMENTS
The corresponding maxima reached are in A359208. The indices at which zeros appear here are in A359209.
LINKS
MATHEMATICA
f[n_] := FromDigits[BitXor[1, IntegerDigits[3*n, 2]], 2]; Table[c=m=0; n=r=i; While[n!=0, c++; n=f[n]; If[n>r, m=c; r=n]]; m, {i, 0, 63}]
PROG
(Python)
def f(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length())-1)
def a(n):
i, fi, m, mi = 0, n, n, 0
while fi != 0:
i, fi = i+1, f(fi)
if fi > m: m, mi = fi, i
return mi
print([a(n) for n in range(64)]) # Michael S. Branicky, Dec 22 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hans Havermann, Dec 22 2022
STATUS
approved