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.

A063250 Number of binary right-rotations (iterations of A038572) to reach fixed point.

This page as a plain text file.
%I A063250 #47 Jun 11 2025 19:28:56
%S A063250 0,0,1,0,2,2,1,0,3,3,3,3,2,2,1,0,4,4,4,4,4,4,4,4,3,3,3,3,2,2,1,0,5,5,
%T A063250 5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,2,2,1,0,6,6,6,6,
%U A063250 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5
%N A063250 Number of binary right-rotations (iterations of A038572) to reach fixed point.
%C A063250 a(n) = 0 when n is a fixed point of form 2^k-1 left-rotation analog appears to be same as A048881.
%C A063250 a(n) is the position of the leftmost 0 in the binary expansion of n (starting from the least significant bit). For example, 44 = 101100_2 and the leftmost 0 is in position 5, so a(44) = 5. - _Chai Wah Wu_, Mar 09 2025
%H A063250 Alois P. Heinz, <a href="/A063250/b063250.txt">Table of n, a(n) for n = 0..32767</a>
%F A063250 If n+1 is a power of 2 then a(n)=0 otherwise a(n) = 1 + a(floor(n/2)).
%F A063250 Conjectured g.f.: 1/(1-x) * Sum_{j>=0} x^(2^j) - (1-x^(2^j)) * Sum_{k>=1} x^((2^j)*(2^k-1)). - _Mikhail Kurkov_, Sep 29 2019
%e A063250 a(11)=3 since under right-rotation 11 -> 13 -> 14 -> 7 and 7 is a fixed point.
%t A063250 Table[Length[FixedPointList[FromDigits[RotateRight[IntegerDigits[ #,2]], 2]&, n]]-2,{n,0,110}] (* _Harvey P. Dale_, Dec 23 2011 *)
%o A063250 (Python)
%o A063250 def a(n):
%o A063250     if n<2: return 0
%o A063250     b=bin(n)[2:]
%o A063250     s=0
%o A063250     while "0" in b:
%o A063250         N=int(b[-1] + b[:-1], 2)
%o A063250         s+=1
%o A063250         b=bin(N)[2:]
%o A063250     return s
%o A063250 print([a(n) for n in range(105)]) # _Indranil Ghosh_, May 25 2017
%o A063250 (Python)
%o A063250 def A063250(n): return 0 if (t:=bin(n)[2:].find('0'))==-1 else n.bit_length()-t # _Chai Wah Wu_, Mar 09 2025
%Y A063250 Cf. A038572, A048881.
%K A063250 base,easy,nonn
%O A063250 0,5
%A A063250 _Marc LeBrun_, Jul 11 2001