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.

A139707 Take n in binary. Rotate the binary digits to the right until a 1 once again appears as the leftmost digit. a(n) is result written in binary.

This page as a plain text file.
%I A139707 #19 Jun 13 2021 06:04:32
%S A139707 1,10,11,100,110,101,111,1000,1100,1010,1101,1001,1110,1011,1111,
%T A139707 10000,11000,10100,11001,10010,11010,10101,11011,10001,11100,10110,
%U A139707 11101,10011,11110,10111,11111,100000,110000,101000,110001,100100,110010
%N A139707 Take n in binary. Rotate the binary digits to the right until a 1 once again appears as the leftmost digit. a(n) is result written in binary.
%C A139707 This sequence written in decimal is A139706.
%H A139707 Harvey P. Dale, <a href="/A139707/b139707.txt">Table of n, a(n) for n = 1..1000</a>
%e A139707 For n = 14: 14 = 1110 in binary. Rotate once to the right, getting 0111. The leftmost digit is a 0, so rotate again to the right, getting 1011. A 1 is the leftmost digit, so stop here. a(14) therefore is 1011 (which is 11 in decimal).
%t A139707 Table[FromDigits[NestWhile[RotateRight[#]&,RotateRight[IntegerDigits[n,2]], #[[1]] != 1&]],{n,40}] (* _Harvey P. Dale_, Oct 26 2016 *)
%Y A139707 Cf. A007088, A139706, A139709.
%K A139707 nonn,base,easy
%O A139707 1,2
%A A139707 _Leroy Quet_, Apr 30 2008
%E A139707 Extended by _Ray Chandler_, Jul 01 2009