cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A359255 #11 Dec 25 2022 14:50:18
%S A359255 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,
%T A359255 2962,1,14,23,24,2963,22,3,8,13,6,0,0,9,0,2961,2,33,26,11,74,4,1591,
%U A359255 69,20,5,3,3,34,9,30,1,16,1,76,11
%N 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.
%C A359255 The corresponding maxima reached are in A359208. The indices at which zeros appear here are in A359209.
%H A359255 Hans Havermann, <a href="/A359255/b359255.txt">Table of n, a(n) for n = 0..10000</a>
%t A359255 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}]
%o A359255 (Python)
%o A359255 def f(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length())-1)
%o A359255 def a(n):
%o A359255     i, fi, m, mi = 0, n, n, 0
%o A359255     while fi != 0:
%o A359255         i, fi = i+1, f(fi)
%o A359255         if fi > m: m, mi = fi, i
%o A359255     return mi
%o A359255 print([a(n) for n in range(64)]) # _Michael S. Branicky_, Dec 22 2022
%Y A359255 Cf. A359194, A359207, A359208, A359209.
%K A359255 nonn,base
%O A359255 0,4
%A A359255 _Hans Havermann_, Dec 22 2022