login
A167021
a(n) = 1 iff 6n+1 is prime.
4
1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1
OFFSET
1,1
EXAMPLE
a(3) = 1 because 6*3+1 is prime;
a(4) = 0 since 6*4+1 is composite.
MATHEMATICA
If[PrimeQ[6#+1], 1, 0]&/@Range[120] (* Harvey P. Dale, Apr 03 2012 *)
PROG
(PARI) a(n) = isprime(6*n+1); \\ Michel Marcus, Jan 19 2019
(Magma) [IsPrime(6*n+1) select 1 else 0:n in [1..105]]; // Marius A. Burtea, Oct 06 2019
CROSSREFS
Cf. A024899, A167020, A132350. For n < 14, a(n) = A132350(n).
Sequence in context: A219009 A353519 A267708 * A267687 A304653 A132350
KEYWORD
nonn
AUTHOR
Washington Bomfim, Oct 27 2009
STATUS
approved