OFFSET
0,4
COMMENTS
LINKS
Hans Havermann, Table of n, a(n) for n = 0..10000
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