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!)
 A109535 a(0) = 1, a(n) = n+a(floor(n/2)) if n mod 2 = 0, a(n) = 2n-a(floor((n-1)/2)) if n mod 2 = 1. 0
 1, 1, 3, 5, 7, 7, 11, 9, 15, 11, 17, 15, 23, 15, 23, 21, 31, 19, 29, 27, 37, 25, 37, 31, 47, 27, 41, 39, 51, 35, 51, 41, 63, 35, 53, 51, 65, 45, 65, 51, 77, 45, 67, 61, 81, 53, 77, 63, 95, 51, 77, 75, 93, 65, 93, 71, 107, 63, 93, 83, 111, 71, 103, 85, 127, 67, 101, 99, 121, 85 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS A slightly different recurrence relation, a(0) = 1, a(n) = n+a(floor(n/2)) if n mod 2 = 0, a(n) = 3n-a(floor((n-1)/2)) if n mod 2 = 1, leads to the odious numbers (odd number of 1's in binary expansion; A000069). LINKS MAPLE a:=proc(n) if n = 0 then 1 elif n mod 2 = 0 then n+a(floor(n/2)) else 2*n-a(floor((n-1)/2)) fi end: seq(a(n), n=0..70); MATHEMATICA a[0] = 1; a[n_] := a[n] = If[Mod[n, 2] == 0, a[Floor[n/2]] + n, -a[Floor[(n - 1)/2]] + 2*n] aa = Table[a[n], {n, 0, 100}] CROSSREFS Cf. A000069. Sequence in context: A195868 A228543 A254764 * A180496 A082433 A082683 Adjacent sequences:  A109532 A109533 A109534 * A109536 A109537 A109538 KEYWORD nonn AUTHOR Roger L. Bagula, Jun 18 2005 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 August 12 16:40 EDT 2020. Contains 336439 sequences. (Running on oeis4.)