OFFSET
1,1
COMMENTS
For primes p <= prime(5000) = 48611, the expression p*q - c with p and q consecutive primes yields more primes at c = 30 than at any other positive c <= 100.
For the above range of primes p, c=30 yields 999 primes, but there are values of c > 100 that yield larger counts; e.g., c = 210, 420, 2310, and 9240 yield 1129, 1194, 1295, and 1316, respectively. - Jon E. Schoenfield, Jun 25 2022
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from K. D. Bajpai)
EXAMPLE
prime(4)*prime(5) - 30 = 7*11 - 30 = 47, which is prime, so 47 is a term.
prime(11)*prime(12) - 30 = 31*37 - 30 = 1117, which is prime, so 1117 is a term.
MAPLE
KD:= proc() local a; a:= ithprime(n)*ithprime(n+1)-30; if isprime((a)) then RETURN((a)):fi; end: seq(KD(), n=1..500);
MATHEMATICA
Select[Table[Prime[n]*Prime[n + 1] - 30, {n, 100}], PrimeQ]
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen():
p, q = 2, 3
while True:
t = p*q-30
if isprime(t):
yield t
p, q = q, nextprime(q)
print(list(islice(agen(), 40))) # Michael S. Branicky, Jun 25 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Sep 26 2013
STATUS
approved