cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A132194 a(n) = 1 if n-th prime is 0 or 2 mod 3, otherwise 0.

This page as a plain text file.
%I A132194 #35 Mar 14 2025 06:14:28
%S A132194 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,
%T A132194 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,
%U A132194 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
%N A132194 a(n) = 1 if n-th prime is 0 or 2 mod 3, otherwise 0.
%C A132194 Equivalently, a(n) = 0 if n-th prime is 1 mod 3, otherwise 1. - _Wouter Meeussen_, May 21 2019
%C A132194 Binary sequence based on the primes: play it at a slower tempo to appreciate the irregularities.
%H A132194 G. C. Greubel, <a href="/A132194/b132194.txt">Table of n, a(n) for n = 1..10000</a>
%H A132194 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>.
%F A132194 a(n) = 1-A099618(n). - _R. J. Mathar_, Jun 06 2019
%F A132194 Sum_{k=1..n} a(k) ~ n / 2. - _Amiram Eldar_, Mar 14 2025
%p A132194 a := n -> 1 - irem(modp(ithprime(n), 3), 2):
%p A132194 seq(a(n), n = 1..105); # _Peter Luschny_, May 21 2019
%t A132194 Table[If[Mod[Prime[n],3]== 1,0,1],{n,200}] (* _Harvey P. Dale_, May 21 2019 *)
%o A132194 (PARI) {a(n) = if(prime(n)%3==1, 0, 1)}; \\ _G. C. Greubel_, May 21 2019
%o A132194 (Magma) [(NthPrime(n) mod 3) eq 1 select 0 else 1: n in [1..200]]; // _G. C. Greubel_, May 21 2019
%o A132194 (Sage)
%o A132194 def a(n):
%o A132194     if (mod(nth_prime(n), 3)==1): return 0
%o A132194     else: return 1
%o A132194 [a(n) for n in (1..200)] # _G. C. Greubel_, May 21 2019
%Y A132194 Characteristic function of A133677.
%Y A132194 Cf. A039701, A130198, A099618.
%K A132194 nonn,easy
%O A132194 1,1
%A A132194 _Roger L. Bagula_, Nov 05 2007
%E A132194 Definition corrected by _Harvey P. Dale_, May 21 2019