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. 13
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; internal format)
OFFSET

1,1

COMMENTS

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

LINKS

Index entries for characteristic functions

FORMULA

a(n)={[(n+1)-(n-1)!^2] mod n}, with n>=1 - Paolo P. Lava (paoloplava(AT)gmail.com), Jan 29 2008

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 (paoloplava(AT)gmail.com), Jan 29 2008

MATHEMATICA

A066247[n_]:=1-Boole[PrimeQ[n]]-KroneckerDelta[n, 1] [From Enrique Perez Herrero (psychgeometry(AT)gmail.com), Oct 13 2010]

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. A002808, A010051, A005171.

Sequence in context: A174898 A099618 A106002 * A151774 A095792 A169675

Adjacent sequences:  A066244 A066245 A066246 * A066248 A066249 A066250

KEYWORD

nonn,easy,changed

AUTHOR

Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 09 2001

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

Content is available under The OEIS End-User License Agreement .

Last modified February 13 18:00 EST 2012. Contains 205531 sequences.