OFFSET
0,5
COMMENTS
A variation on Hofstadter's G-sequence, Hofstadter's Q-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
Eric Weisstein's World of Mathematics, Hofstadter's Q-Sequence
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], n/2 - a[a[n/2]], a[(n - 1)/2 - a[(n - 1)/2]] + a[(n - 1)/2 - a[(n + 1)/2]]]; Table[a[n], {n, 0, 85}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 25 2017
STATUS
approved