login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080339 Characteristic function of {1} union {primes}: 1 if n is 1 or a prime, else 0. 25
1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Characteristic function of noncomposite numbers (see A008578). - Omar E. Pol, Oct 07 2013
LINKS
Aminu Alhaji Ibrahim, Sa’idu Isah Abubaka, Aunu Integer Sequence as Non-Associative Structure and Their Graph Theoretic Properties, Advances in Pure Mathematics, 2016, 6, 409-419.
Eric Weisstein's World of Mathematics, Prime Formulas
FORMULA
a(1)=1, and a(n) = Prod_{k=1...n-1}(k/n)^2 where (a/b) is the Jacobi symbol and n>1. - Dimitri Papadopoulos, Jan 13 2016
MAPLE
1, seq(`if`(isprime(i), 1, 0), i=2..100); # Robert Israel, Jan 11 2016
MATHEMATICA
Table[Which[n == 1, 1, PrimeQ[n], 1, True, 0], {n, 110}] (* Harvey P. Dale, Oct 03 2011 *)
Table[Boole[PrimeOmega[n] < 2], {n, 100}] (* Alonso del Arte, Nov 19 2013 *)
PROG
(PARI) a(n) = (n==1) + isprime(n); \\ Michel Marcus, Jan 13 2016
CROSSREFS
Cf. A036234 (partial sums).
Sequence in context: A187036 A192490 A267133 * A294905 A353787 A297086
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Mar 21 2003
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 04:51 EDT 2024. Contains 371798 sequences. (Running on oeis4.)