OFFSET
1,1
MAPLE
f:= proc(p) local k;
for k from 1 while isprime(p+k*(k+1)*7) do od:
k
end proc:
A:= Vector(12): count:= 0:
for i from 1 while count < 12 do
v:= f(ithprime(i));
if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
od:
convert(A, list);
MATHEMATICA
Table[p=1; m=7; Monitor[Parallelize[While[True, If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1), {k, 0, n-1}]], False]==False, PrimeQ[p+m*n*(n+1)]==False], Break[]]; p++]; p], p], {n, 1, 10}]
PROG
(PARI) isok(p, n) = for (k=0, n-1, if (! isprime(p + 7*k*(k+1)), return(0))); return (!isprime(p + 7*n*(n+1)));
a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p;
(Perl) use ntheory qw(:all); sub a { my $n = $_[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($_ + 7*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 7*$_*($_+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " }; # Daniel Suteu, Oct 04 2024
CROSSREFS
KEYWORD
nonn,more
AUTHOR
J.W.L. (Jan) Eerland, Oct 01 2024
EXTENSIONS
a(11)-a(12) from Hugo Pfoertner, Oct 01 2024
a(13)-a(14) from Hugo Pfoertner, Oct 03 2024
a(15)-a(16) from Daniel Suteu, Oct 04 2024
STATUS
approved