OFFSET
1,1
COMMENTS
All terms are = 1 mod 30.
Note that 4th iteration gives composite integer = 5 mod 10.
(a(n)-1)/30 = 2, 212, 359, 377, 593, 649, 667, 813, 865,...
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 61 because 6*61 + 1 = 367, 6*367 + 1 = 2203, and 6*2203 + 1 = 13219 are all primes = 1 mod 6.
MATHEMATICA
p=31; Reap[Do[If[Union[PrimeQ[NestList[6#+1&, p, 3]]]=={True}, Sow[p]]; p=p+30, {10^4}]][[2, 1]]
PROG
(PARI) {p=31; for(i=1, 10^4, p=p+30; if(isprime(p)&&isprime(q=6*p+1)&&isprime(r=6*q+1)&&isprime(6*r+1), print1(p", ")))}
(PARI) forprime(p=2, 1e6, if(p%30<2&&isprime(6*p+1)&&isprime(36*p+7)&&isprime(216*p+43), print1(p", "))) \\ Charles R Greathouse IV, Mar 29 2012
(Magma) [p: p in PrimesUpTo(22*10^4) | p mod 6 eq 1 and forall{q: i in [1..3] | IsPrime(q) where q is (6^i*(5*p+1)-1) div 5}]; // Bruno Berselli, Mar 29 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 28 2012
STATUS
approved