OFFSET
1,1
COMMENTS
Characteristic function of noncomposite numbers (see A008578). - Omar E. Pol, Oct 07 2013
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,easy,changed
AUTHOR
N. J. A. Sloane, Mar 21 2003
STATUS
approved