login
A355845
First of three consecutive primes p,q,r such that p*r - q^2 + q*r is prime.
1
3, 5, 7, 11, 13, 17, 29, 41, 71, 79, 89, 97, 107, 137, 163, 167, 179, 223, 241, 311, 313, 347, 379, 479, 487, 503, 547, 569, 587, 659, 691, 701, 821, 857, 863, 883, 907, 929, 983, 1009, 1109, 1117, 1153, 1163, 1171, 1217, 1429, 1453, 1483, 1493, 1523, 1549, 1583, 1637, 1693, 1753, 1783, 1823
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
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
Sequence in context: A118939 A239391 A087382 * A025127 A024883 A024328
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 18 2022
STATUS
approved