OFFSET
1,1
FORMULA
a(2n) == 1 (mod 6) & a(2n+1) == -1 (mod 6).
MATHEMATICA
a[1] = 5; a[n_] := a[n] = Block[{k = a[n - 1] + 3 + If[ Mod[a[n - 1], 3] == 1, 1, -1]}, While[ !PrimeQ[k], k += 6]; k]; Table[ a[n], {n, 60}]
PROG
(PARI) p=5; q=7; i=0; while(i++<99, if(p<q, print1(p", "); while((p=nextprime(p+6))%6!=5, ), print1(q", "); while((q=nextprime(q+6))%6!=1, ))) \\ Charles R Greathouse IV, May 15 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray Chandler and Robert G. Wilson v, Jan 25 2005
STATUS
approved