login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Table of n, a(n) for n=0..85.

Eric Weisstein's World of Mathematics, Stern's Diatomic Series

Eric Weisstein's World of Mathematics, Hofstadter G-Sequence

Index entries for sequences related to Stern's sequences

Index entries for Hofstadter-type sequences

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

Cf. A002487, A005206, A046698, A287475, A287476, A287477.

Sequence in context: A274451 A193787 A072614 * A238552 A257523 A067044

Adjacent sequences:  A287594 A287595 A287596 * A287598 A287599 A287600

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 01:48 EDT 2021. Contains 348160 sequences. (Running on oeis4.)