login
Denominator of the mediant of prime(n) / prime(n+1) and prime(n+2) / prime(n+3).
2

%I #17 Oct 09 2021 03:34:34

%S 10,8,5,7,8,5,6,9,11,12,10,11,12,53,57,21,22,35,15,26,14,15,19,20,26,

%T 53,55,59,61,66,45,143,145,153,157,162,28,173,177,185,187,194,98,51,

%U 211,219,226,115,117,79,245,249,257,263,267,91,92,70,41,295,302

%N Denominator of the mediant of prime(n) / prime(n+1) and prime(n+2) / prime(n+3).

%C 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.

%H Colin Barker, <a href="/A280871/b280871.txt">Table of n, a(n) for n = 1..1000</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Mediant_(mathematics)">Mediant</a>

%e The mediant of 2/3 and 5/7 is 7/10.

%t Map[Denominator[(#1 + #3)/(#2 + #4)] & @@ # &, Partition[Prime@ Range[64], 4, 1]] (* _Michael De Vlieger_, Oct 08 2021 *)

%o (PARI) vector(100, n, denominator((prime(n)+prime(n+2)) / (prime(n+1)+prime(n+3))))

%o (Python)

%o from math import gcd

%o from sympy import nextprime

%o def aupton(terms):

%o alst, p, q, r, s = [], 2, 3, 5, 7

%o while len(alst) < terms:

%o alst.append((q+s)//gcd(p+r, q+s))

%o p, q, r, s = q, r, s, nextprime(s)

%o return alst

%o print(aupton(61)) # _Michael S. Branicky_, Oct 08 2021

%Y Cf. A000040, A280870.

%K nonn,frac

%O 1,1

%A _Colin Barker_, Jan 09 2017