OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..2000
EXAMPLE
a(5) = 7: 7+6*5 = 7+30 = 37, 7+12*5 = 7+60 = 67, and 7+18*5 = 7+90 = 97 are all prime.
MATHEMATICA
Module[{nn=100, prs}, prs=Prime[Range[nn]]; Table[SelectFirst[prs, AllTrue[ #+6*Range[3]*n, PrimeQ]&], {n, nn/2}]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 22 2018 *)
PROG
(Magma) prs := [NthPrime(i) : i in [1..200]]; result := []; for n in [1..100] do for p in prs do if forall{k : k in [1..3] | IsPrime(p + 6*n*k)} then Append(~result, p); break; end if; end for; end for; result; // Vincenzo Librandi, Jul 26 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray G. Opao, Apr 06 2004
STATUS
approved
