OFFSET
1,4
COMMENTS
a(n)/A287731(n) enumerates all reduced fractions along the Stern-Brocot Tree. See the Serov link below.
LINKS
FORMULA
PROG
(Python)
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)
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)
def a(n): return s(2*n - 1) # Indranil Ghosh, Jun 08 2017
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
I. V. Serov, Jun 01 2017
STATUS
approved