This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A135586 a(1)=0; for n >= 1, a(2n)=a(n)+2^A000120(n)-1, a(2n+1)=2a(2n). 3
 0, 1, 2, 2, 4, 5, 10, 3, 6, 7, 14, 8, 16, 17, 34, 4, 8, 9, 18, 10, 20, 21, 42, 11, 22, 23, 46, 24, 48, 49, 98, 5, 10, 11, 22, 12, 24, 25, 50, 13, 26, 27, 54, 28, 56, 57, 114, 14, 28, 29, 58, 30, 60, 61, 122, 31, 62, 63, 126, 64, 128, 129, 258, 6, 12, 13, 26, 14, 28, 29, 58, 15, 30 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 LINKS R. Zumkeller, Table of n, a(n) for n = 1..10000 FORMULA If n=2^{e_{k-1}}+ ... +2^{e_1}+2^{e_0}, where k=A000120(n) and e_{k-1}> ... >e_1>e_0, then a(n)=e_0+2e_1+ ... +2^{k-1}e_{k-1}. a(2^k) = k; a(4*k+2) = a(4*k+1) + 1; a(4*k+3) = 2*a(4*k+2). - Reinhard Zumkeller, Mar 02 2008 MAPLE b:=proc(n)if n=0 then 0 elif `mod`(n, 2)=0 then b((1/2)*n) else b((1/2)*n-1/2)+1 end if end proc: a:=proc(n) if n=1 then 0 elif `mod`(n, 2)=0 then a((1/2)*n)+2^b(n)-1 else 2*a(n-1) end if end proc: seq(a(n), n=1..60); # Emeric Deutsch, Mar 02 2008 MATHEMATICA a = {0}; For[n = 2, n < 80, n++, If[OddQ[n], AppendTo[a, 2*a[[ -1]]], AppendTo[a, a[[n/2]] + 2^Length[Select[IntegerDigits[n/2, 2], # == 1 &]] - 1]]]; a (* Stefan Steinerberger, Mar 02 2008 *) CROSSREFS Cf. A135587, A000120, A135533. Sequence in context: A188541 A037026 A116651 * A168542 A116646 A306318 Adjacent sequences:  A135583 A135584 A135585 * A135587 A135588 A135589 KEYWORD nonn,easy,look AUTHOR Don Knuth, Mar 01 2008 EXTENSIONS More terms from Reinhard Zumkeller, Emeric Deutsch and Stefan Steinerberger, Mar 02 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 October 17 15:01 EDT 2019. Contains 328116 sequences. (Running on oeis4.)