login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A038572 a(n) = n rotated one binary place to the right. 27
0, 1, 1, 3, 2, 6, 3, 7, 4, 12, 5, 13, 6, 14, 7, 15, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31, 16, 48, 17, 49, 18, 50, 19, 51, 20, 52, 21, 53, 22, 54, 23, 55, 24, 56, 25, 57, 26, 58, 27, 59, 28, 60, 29, 61, 30, 62, 31, 63, 32, 96, 33, 97, 34, 98, 35, 99, 36, 100 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

Iterating a(n), a(a(n)), ... eventually leads to 2^A000120(n) - 1. - Franklin T. Adams-Watters, Apr 09 2010

LINKS

T. D. Noe, Table of n, a(n) for n = 0..1023

FORMULA

a(n) = A053645(n) * A000035(n) + A004526(n) = most significant bit(n) * least significant bit(n) + floor(n/2).

a(0)=0, a(1)=1, a(2n) = n, a(2n+1) = 2a(n) + 2a(n+1) - n. - Ralf Stephan, Oct 24 2003

MAPLE

A038572 := proc(n)

    convert(n, base, 2) ;

    ListTools[Rotate](%, 1) ;

    add( op(i, %)*2^(i-1), i=1..nops(%)) ;

end proc: # R. J. Mathar, May 20 2016

MATHEMATICA

Table[ FromDigits[ RotateRight[ IntegerDigits[n, 2]], 2], {n, 0, 80}] (* Robert G. Wilson v *)

PROG

(Haskell)

a038572 0 = 0

a038572 n = a053645 n * m + n' where (n', m) = divMod n 2

-- Reinhard Zumkeller, Dec 03 2012

(PARI) a(n)=if(n<2, return(n)); my(d=binary(n)); fromdigits(concat(d[#d], d[1..#d-1]), 2) \\ Charles R Greathouse IV, Sep 02 2015

CROSSREFS

Cf. A006257, A088146.

Sequence in context: A071018 A144559 A155114 * A245676 A060992 A064455

Adjacent sequences:  A038569 A038570 A038571 * A038573 A038574 A038575

KEYWORD

easy,nonn,nice

AUTHOR

Marc LeBrun

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified August 30 00:52 EDT 2016. Contains 275961 sequences.