%N The first member p of a triple (p,q,r) of consecutive primes such that a solution to p/q < r/s < q/r or p/q > r/s > q/r with s prime exists.
%C For any three consecutive primes p, q and r, is it reasonable to say that a countless number of pairs (p1,p2) forming the fraction p1/p2 will fit inside the interval p/q to q/r?
%C Equivalent definition: smallest p in a triple (p,q,r) of consecutive primes such that there is at least one prime in the interval spanned by the minimum and maximum of r^2/q and rq/p.
%F Look for an r/s so that p/q < r/s < q/r.
%e For p = 103, we have primes 103, 107 and 109 to form fractions 103/107 = 0.9439 and 107/109 = 0.9817. Will a prime greater than 109 form a fraction that fits? Try 109/113 = 0.9646 and it fits inside the interval.
%e p=103 is in the sequence because p=103, q=107, r=109 solve p/q < r/s < q/r choosing s=113 (a prime).
%p isA107664 := proc(p) local q,r,s ; if isprime(p) then q := nextprime(p) ; r := nextprime(q) ; if p*r < q^2 then for s from ceil(r^2/q) to floor(r*q/p) do if isprime(s) then RETURN(true) ; fi ; od ; elif p*r > q^2 then for s from ceil(r*q/p) to floor(r^2/q) do if isprime(s) then RETURN(true) ; fi ; od ; fi ; RETURN(false) ; else RETURN(false) ; fi ; end: for i from 1 to 300 do p := ithprime(i) ; if isA107664(p) then printf("%d,",p) ; fi ; od:
%A _J. M. Bergot_, Jun 22 2007
%E Edited by _R. J. Mathar_, Jul 13 2007