%I #9 May 15 2013 18:37:32
%S 5,7,11,13,17,19,23,31,41,43,47,61,71,73,83,97,101,103,107,109,113,
%T 127,131,139,149,151,167,181,191,193,197,199,227,229,233,241,251,271,
%U 281,283,293,307,311,313,317,331,347,349,353,367,383,397,401,409,419,421
%N Increasing primes of alternating congruences modulo 6.
%F a(2n) == 1 (mod 6) & a(2n+1) == -1 (mod 6).
%t 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}]
%o (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
%Y Cf. A100859.
%K nonn
%O 1,1
%A _Ray Chandler_ and _Robert G. Wilson v_, Jan 25 2005
|