login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A353153 Primes p such that (q-p)*p*q+1 is prime, where q is the next prime after p. 1
2, 3, 5, 17, 23, 31, 41, 47, 73, 101, 107, 167, 191, 199, 227, 269, 271, 311, 331, 373, 443, 541, 569, 571, 587, 593, 619, 647, 653, 661, 733, 751, 881, 941, 977, 1031, 1063, 1103, 1117, 1123, 1187, 1307, 1427, 1433, 1451, 1499, 1553, 1637, 1709, 1747, 1753, 1811, 1889, 1949, 1973, 1987, 2069 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 5 is a term because the next prime is 7 and (7-5)*5*7+1 = 71 is prime.
MAPLE
R:= NULL: count := 0:
q:= 2:
while count < 100 do
p:= q; q:= nextprime(q);
if isprime((q-p)*p*q+1) then
count:= count+1;
R:= R, p;
fi
od:
R;
MATHEMATICA
Select[Range[2000], PrimeQ[#] && PrimeQ[((q = NextPrime[#]) - #) * # * q + 1] &] (* Amiram Eldar, Apr 27 2022 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
p, q = 2, 3
while True:
if isprime((q-p)*p*q+1):
yield p
p, q = q, nextprime(q)
print(list(islice(agen(), 20))) # Michael S. Branicky, Apr 27 2022
CROSSREFS
Cf. A001223 (prime gaps).
Sequence in context: A111632 A049547 A049577 * A121558 A240679 A180474
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 26 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 27 10:11 EDT 2024. Contains 375468 sequences. (Running on oeis4.)