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!)
A287597 a(0) = 0, a(1) = 1; a(2*n) = n - a(a(n)), a(2*n+1) = a(a(n)) + a(a(n+1)). 1
0, 1, 0, 1, 2, 1, 2, 1, 4, 1, 4, 1, 6, 1, 6, 3, 6, 3, 8, 3, 8, 3, 10, 3, 10, 3, 12, 3, 12, 3, 14, 3, 14, 3, 16, 5, 14, 5, 18, 5, 16, 5, 20, 5, 18, 5, 22, 5, 20, 5, 24, 7, 20, 7, 26, 7, 22, 7, 28, 7, 24, 7, 30, 7, 26, 7, 32, 7, 28, 7, 34, 7, 30, 7, 36, 9, 30, 9, 38, 7, 34, 7, 40, 9, 34, 9 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
A variation on Hofstadter's G-sequence and Stern's diatomic sequence.
LINKS
Eric Weisstein's World of Mathematics, Stern's Diatomic Series
Eric Weisstein's World of Mathematics, Hofstadter G-Sequence
FORMULA
a(2*n) + a(2*n+1) + a(2*n+2) = 2*n + 1 (from definition).
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], n/2 - a[a[n/2]], a[a[(n - 1)/2]] + a[a[(n + 1)/2]]]; Table[a[n], {n, 0, 85}]
CROSSREFS
Sequence in context: A274451 A193787 A072614 * A238552 A257523 A067044
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 27 2017
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 August 7 12:12 EDT 2024. Contains 375012 sequences. (Running on oeis4.)