login
A101635
Increasing primes of alternating congruences modulo 6.
0
5, 7, 11, 13, 17, 19, 23, 31, 41, 43, 47, 61, 71, 73, 83, 97, 101, 103, 107, 109, 113, 127, 131, 139, 149, 151, 167, 181, 191, 193, 197, 199, 227, 229, 233, 241, 251, 271, 281, 283, 293, 307, 311, 313, 317, 331, 347, 349, 353, 367, 383, 397, 401, 409, 419, 421
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
Cf. A100859.
Sequence in context: A364001 A216523 A230227 * A118941 A096547 A216524
KEYWORD
nonn
AUTHOR
STATUS
approved