OFFSET
1,1
COMMENTS
The mediant of two reduced proper fractions a/b and c/d is (a+c)/(b+d), the value of which is strictly between a/b and c/d.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Wikipedia, Mediant
EXAMPLE
The mediant of 2/3 and 5/7 is 7/10.
MATHEMATICA
Array[Numerator[(#1 + #3)/(#2 + #4)] & @@ Prime@ Range[#, # + 3] &, 61] (* Michael De Vlieger, Oct 08 2021 *)
PROG
(PARI) vector(100, n, numerator((prime(n)+prime(n+2)) / (prime(n+1)+prime(n+3))))
(Python)
from math import gcd
from sympy import nextprime
def aupton(terms):
alst, p, q, r, s = [], 2, 3, 5, 7
while len(alst) < terms:
alst.append((p+r)//gcd(p+r, q+s))
p, q, r, s = q, r, s, nextprime(s)
return alst
print(aupton(61)) # Michael S. Branicky, Oct 08 2021
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Colin Barker, Jan 09 2017
STATUS
approved