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.
%I A287731 #44 Jun 10 2017 03:49:28 %S A287731 1,1,2,1,1,2,3,3,4,5,5,4,3,3,2,1,1,2,3,3,4,5,5,4,5,7,8,7,7,8,7,5,6,9, %T A287731 11,10,11,13,12,9,9,12,13,11,10,11,9,6,5,7,8,7,7,8,7,5,4,5,5,4,3,3,2,1 %N A287731 Bisection of A287729. %C A287731 A287732(n)/a(n) enumerates all reduced fractions along the Stern-Brocot Tree. See the Serov link below. %H A287731 I. V. Serov, <a href="/A287731/b287731.txt">Table of n, a(n) for n = 1..8192</a> %H A287731 I. V. Serov, <a href="/A287731/a287731.png">The Stern-Brocot Tree as Sequence A287732/A287731</a> %H A287731 N. J. A. Sloane, <a href="/stern_brocot.html">Stern-Brocot or Farey Tree</a> %H A287731 <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a> %H A287731 <a href="/index/Fo#fraction_trees">Index entries for fraction trees</a> %F A287731 a(n) = A287729(2*n-1), n > 0. %F A287731 a(n) = A287730(n-1) + A287730(n), n > 0. %F A287731 a(n) = A007306(n) - A287732(n) . %F A287731 Consider for n > 1 the binary expansion b(1:t) of n-1 without the leading 1. %F A287731 Recurse: c=s=1; for j=1:t {if b(t-j+1) == mod(t,2) s = s+c; else c = c+s;} %F A287731 Then: c = a(n) and s = A287732(n); %o A287731 (Python) %o A287731 def c(n): return 1 if n==1 else s(n/2) if n%2==0 else s((n - 1)/2) + s((n + 1)/2) %o A287731 def s(n): return 0 if n==1 else c(n/2) if n%2==0 else c((n - 1)/2) + c((n + 1)/2) %o A287731 def a(n): return c(2*n - 1) # _Indranil Ghosh_, Jun 08 2017 %Y A287731 Cf. A002487, A007306, A287729, A287730, A287732. %K A287731 nonn,frac %O A287731 1,3 %A A287731 _I. V. Serov_, Jun 01 2017