login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A287475
a(0) = 0; a(1) = 1; a(2*n) = a(n), a(2*n+1) = a(n-a(n)) + a(n-a(n+1)).
4
0, 1, 1, 0, 1, 2, 0, 1, 1, 1, 2, 2, 0, 2, 1, 0, 1, 2, 1, 2, 2, 2, 2, 3, 0, 2, 2, 2, 1, 3, 0, 1, 1, 1, 2, 1, 1, 3, 2, 4, 2, 2, 2, 4, 2, 4, 3, 5, 0, 2, 2, 6, 2, 0, 2, 4, 1, 4, 3, 5, 0, 3, 1, 0, 1, 2, 1, 2, 2, 2, 1, 4, 1, 2, 3, 3, 2, 3, 4, 4, 2, 4, 2, 8, 2, 4, 4, 6, 2, 4, 4, 4, 3, 6, 5, 7, 0, 3, 2, 10, 2
OFFSET
0,6
COMMENTS
A variation on Hofstadter's Q-sequence and Stern's diatomic sequence.
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], a[n/2], a[(n - 1)/2 - a[(n - 1)/2]] + a[(n - 1)/2 - a[(n + 1)/2]]]; Table[a[n], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 25 2017
STATUS
approved