login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A296028
Characteristic function of primes in the nonmultiples of 3.
1
0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1
OFFSET
1
FORMULA
From David A. Corneth, Dec 03 2017: (Start)
a(n) = A010051(A001651(n)).
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
STATUS
approved