A132194 a(n) = 1 if n-th prime is 0 or 2 mod 3, otherwise 0.
1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0
Offset: 1
Links
Programs
-
Magma
[(NthPrime(n) mod 3) eq 1 select 0 else 1: n in [1..200]]; // G. C. Greubel, May 21 2019
-
Maple
a := n -> 1 - irem(modp(ithprime(n), 3), 2): seq(a(n), n = 1..105); # Peter Luschny, May 21 2019
-
Mathematica
Table[If[Mod[Prime[n],3]== 1,0,1],{n,200}] (* Harvey P. Dale, May 21 2019 *)
-
PARI
{a(n) = if(prime(n)%3==1, 0, 1)}; \\ G. C. Greubel, May 21 2019
-
Sage
def a(n): if (mod(nth_prime(n), 3)==1): return 0 else: return 1 [a(n) for n in (1..200)] # G. C. Greubel, May 21 2019
Formula
a(n) = 1-A099618(n). - R. J. Mathar, Jun 06 2019
Sum_{k=1..n} a(k) ~ n / 2. - Amiram Eldar, Mar 14 2025
Extensions
Definition corrected by Harvey P. Dale, May 21 2019
Comments