The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A139709 Take n in binary. Rotate the binary digits to the left until a 1 once again appears as the leftmost digit. a(n) is result written in binary. 3
 1, 10, 11, 100, 110, 101, 111, 1000, 1100, 1010, 1110, 1001, 1011, 1101, 1111, 10000, 11000, 10100, 11100, 10010, 10110, 11010, 11110, 10001, 10011, 10101, 10111, 11001, 11011, 11101, 11111, 100000, 110000, 101000, 111000, 100100, 101100 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS This sequence written in decimal is A139708. LINKS Michael De Vlieger, Table of n, a(n) for n = 1..10000 EXAMPLE For n = 11 (in decimal): 11 (in decimal) = 1011 in binary. Rotate once to the left, getting 0111. The leftmost digit is a 0, so rotate again to the left, getting 1110. A 1 is the leftmost digit, so stop here. a(11) therefore is 1110 (which is 14 in decimal). MAPLE A007088 := proc(L) local i ; add(op(i, L)*10^(i-1), i=1..nops(L)) : end: A139709 := proc(n) local a; a := ListTools[Rotate](convert(n, base, 2), -1) ; while op(-1, a) = 0 do a := ListTools[Rotate](a, -1) ; od: A007088(a) ; end: seq(A139709(n), n=1..80) ; # R. J. Mathar, May 04 2008 MATHEMATICA Array[FromDigits@ NestWhile[RotateLeft, IntegerDigits[#, 2], First@ # == 0 &, {2, 1}] &, 37] (* Michael De Vlieger, Oct 22 2017 *) PROG (PARI) rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v a(n) = my(b=rot(binary(n))); while(b[1]==0, b=rot(b)); subst(Pol(b), x, 10) \\ Felix FrÃ¶hlich, Oct 22 2017 CROSSREFS Cf. A139707, A139708. Sequence in context: A043681 A234472 A139707 * A221714 A309761 A108779 Adjacent sequences:  A139706 A139707 A139708 * A139710 A139711 A139712 KEYWORD nonn,base AUTHOR Leroy Quet, Apr 30 2008 EXTENSIONS More terms from R. J. Mathar, May 04 2008 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 24 20:13 EDT 2020. Contains 337321 sequences. (Running on oeis4.)