OFFSET
1
FORMULA
From David A. Corneth, Dec 03 2017: (Start)
a(n) = 1 if (6n - 3 - (-1)^n)/4 is prime, otherwise a(n) = 0. (End)
EXAMPLE
a(2) = 1 because the 2nd nonmultiple of 3 is 2, which is prime.
MAPLE
f:= n -> charfcn[{true}](isprime(floor((3*n-1)/2))):
map(f, [$1..1000]); # Robert Israel, Jan 24 2018
MATHEMATICA
Array[Boole@ PrimeQ@ Floor[(3 # - 1)/2] &, 105] (* Michael De Vlieger, Dec 03 2017 *)
PROG
(PARI) a(n) = isprime(floor((3*n-1)/2)) \\ Iain Fox, Dec 03 2017
(PARI) first(n) = {my(inc = t = 1, res = vector(n)); for(i = 1, n, res[i] = isprime(t); t += inc; inc = 3-inc); res} \\ David A. Corneth, Dec 03 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Martin Michael Musatov, Dec 03 2017
STATUS
approved