login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A065357
a(n) = (-1)^pi(n) where pi(n) is the number of primes <= n.
5
1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1
OFFSET
0,1
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..10000 (First 1000 terms from Harry J. Smith)
MATHEMATICA
(-1)^PrimePi[Range[0, 110]] (* Harvey P. Dale, Nov 02 2015 *)
PROG
(PARI) { for (n=0, 1000, if (n, a=(-1)^primepi(n), a=1); write("b065357.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 30 2009
CROSSREFS
Sequence in context: A130151 A143431 A064179 * A119665 A121241 A122188
KEYWORD
easy,sign
AUTHOR
Jason Earls, Oct 31 2001
STATUS
approved