OFFSET
1,1
COMMENTS
Conjecture: only 130633 primes are not in the sequence: 2, 3, ..., 94532497.
LINKS
Alois P. Heinz and Lei Zhou, Table of n, a(n) for n = 1..10000 (terms n = 1..2000 from Alois P. Heinz)
EXAMPLE
457 is in the sequence because with D=150: 7, 157, 307, 607, 757, 907 are all primes.
MAPLE
a:= proc(n) option remember; local D, p;
p:= `if`(n=1, 1, a(n-1));
do p:= nextprime(p);
for D to iquo(p, 3) do
if nops(select(isprime, {(p-k*D)$k=-3..3}))=7
then return p fi
od
od
end:
seq (a(n), n=1..40); # Alois P. Heinz, Aug 26 2012
MATHEMATICA
a[n_] := a[n] = Module[{D, p}, p = If[n==1, 1, a[n-1]]; While[True, p = NextPrime[p]; For[D = 1, D <= Quotient[p, 3], D++, If[AllTrue[p - Range[-3, 3] D, PrimeQ], Return [p]]]]];
Array[a, 40] (* Jean-François Alcover, Nov 13 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Aug 25 2012
STATUS
approved