login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066247 Characteristic function of composite numbers: 1 if n is composite else 0. 25
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

a(n) = signum(A066246(n)), where signum = A057427. For n > 1: a(n) = 1 - A010051(n) = A005171(n).

a(n) = A057427(A086971(n)). - Reinhard Zumkeller, Dec 14 2012

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..65537

Index entries for characteristic functions

Index entries for sequences computed from exponents in factorization of n

FORMULA

a(n) = ((n+1)-(n-1)!^2) mod n, with n>=1 - Paolo P. Lava, Jan 29 2008

For n>1 a(n) = 1-floor(1/A001222(n)). - Enrique Pérez Herrero, Aug 08 2012

a(n) = A065855(n)-A065855(n-1) = 1-A000720(n)+A000720(n-1). - Chayim Lowen, Jul 23 2015

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

MAPLE

P:=proc(n) local i; for i from 1 by 1 to n do print(((i+1)-(i-1)!^2) mod i); od; end: P(100); # Paolo P. Lava, Jan 29 2008

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 *)

PROG

(PARI) a(n)=!isprime(n)&&n>1 \\ Charles R Greathouse IV, Aug 21 2011

(Haskell)

a066247 1 = 0

a066247 n = 1 - a010051 n  -- Reinhard Zumkeller, Feb 04 2012

CROSSREFS

Cf. A001222, A002808, A010051, A005171.

Cf. A065855 (partial sums).

Sequence in context: A174898 A099618 A106002 * A151774 A095792 A169675

Adjacent sequences:  A066244 A066245 A066246 * A066248 A066249 A066250

KEYWORD

nonn,easy

AUTHOR

Reinhard Zumkeller, Dec 09 2001

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 18 07:01 EST 2018. Contains 317279 sequences. (Running on oeis4.)