login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A109536 a(0) = 1, a(n) = n+a(floor(n/2)) if n mod 2 = 0, a(n) = n-a(floor((n-1)/2)) if n mod 2 = 1. 1
1, 0, 2, 3, 6, 3, 9, 4, 14, 3, 13, 8, 21, 4, 18, 11, 30, 3, 21, 16, 33, 8, 30, 15, 45, 4, 30, 23, 46, 11, 41, 20, 62, 3, 37, 32, 57, 16, 54, 23, 73, 8, 50, 35, 74, 15, 61, 32, 93, 4, 54, 47, 82, 23, 77, 32, 102, 11, 69, 48, 101, 20, 82, 43, 126, 3, 69, 64, 105, 32, 102, 39, 129, 16 (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 n-a(floor((n-1)/2)) fi end: seq(a(n), n=0..90);
MATHEMATICA
a[0] = 1; a[n_] := a[n] = If[Mod[n, 2] == 0, a[Floor[n/2]] + n, -a[Floor[(n - 1)/2]] + n] aa = Table[a[n], {n, 0, 100}]
CROSSREFS
Cf. A000069.
Sequence in context: A129915 A019773 A350728 * A267352 A101401 A106834
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 02:37 EDT 2024. Contains 372300 sequences. (Running on oeis4.)