A066247 Characteristic function of composite numbers: 1 if n is composite else 0.
0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1
Offset: 1
Links
Programs
-
Haskell
a066247 1 = 0 a066247 n = 1 - a010051 n -- Reinhard Zumkeller, Feb 04 2012
-
Mathematica
A066247[n_]:=1-Boole[PrimeQ[n]]-KroneckerDelta[n, 1] (* Enrique Pérez Herrero, Oct 13 2010 *) Table[Boole[CompositeQ[n]], {n, 1, 105}] (* Jean-François Alcover, Jan 25 2018 *)
-
PARI
a(n)=!isprime(n)&&n>1 \\ Charles R Greathouse IV, Aug 21 2011
Formula
For n>1 a(n) = 1-floor(1/A001222(n)). - Enrique Pérez Herrero, Aug 08 2012
Dirichlet g.f.: Sum_{n>=1} a(n)/n^s = Zeta(s)-1-P(s), where P is prime zeta. - Enrique Pérez Herrero, Aug 08 2012
a(n) = 1 if A001222(n) > 1, 0 otherwise. - Antti Karttunen, Nov 20 2017
Comments