cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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)).

This page as a plain text file.
%I A287597 #7 Feb 16 2025 08:33:46
%S A287597 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,
%T A287597 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,
%U A287597 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
%N 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)).
%C A287597 A variation on Hofstadter's G-sequence and Stern's diatomic sequence.
%H A287597 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SternsDiatomicSeries.html">Stern's Diatomic Series</a>
%H A287597 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HofstadterG-Sequence.html">Hofstadter G-Sequence</a>
%H A287597 <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>
%H A287597 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>
%F A287597 a(2*n) + a(2*n+1) + a(2*n+2) = 2*n + 1 (from definition).
%t A287597 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}]
%Y A287597 Cf. A002487, A005206, A046698, A287475, A287476, A287477.
%K A287597 nonn
%O A287597 0,5
%A A287597 _Ilya Gutkovskiy_, May 27 2017