OFFSET
1,1
COMMENTS
First of three consecutive primes p,q,r such that the sum of numerator and denominator of p/q - q/r is prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 7 is a term because 7, 11 and 13 are consecutive primes and 7*13 - 11^2 + 11*13 = 113 is prime.
MAPLE
q:= 2: r:= 3: count:= 0: R:= NULL:
while count < 100 do
p:= q; q:= r; r:= nextprime(r);
if isprime(p*r-q^2+q*r) then
count:= count+1; R:= R, p;
fi
od:
R;
MATHEMATICA
Select[Partition[Prime[Range[300]], 3, 1], PrimeQ[(#[[1]] + #[[2]])*#[[3]] - #[[2]]^2] &][[;; , 1]] (* Amiram Eldar, Jul 18 2022 *)
PROG
(PARI) is(p)=if(!isprime(p), return(0)); my(q=nextprime(p+1), r=nextprime(q+2)); isprime(p*r-q^2+q*r) \\ Charles R Greathouse IV, Jul 18 2022
(PARI) list(lim)=my(v=List(), p=3, q=5); forprime(r=7, nextprime(nextprime(lim\1+1)+1), if(isprime(p*r-q^2+q*r), listput(v, p)); p=q; q=r); Vec(v) \\ Charles R Greathouse IV, Jul 18 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 18 2022
STATUS
approved