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!)
A065357 a(n) = (-1)^pi(n) where pi(n) is the number of primes <= n. 3

%I #26 Jun 18 2018 11:44:39

%S 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,

%T -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,

%U 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

%N a(n) = (-1)^pi(n) where pi(n) is the number of primes <= n.

%H N. J. A. Sloane, <a href="/A065357/b065357.txt">Table of n, a(n) for n = 0..10000</a> (First 1000 terms from Harry J. Smith)

%t (-1)^PrimePi[Range[0,110]] (* _Harvey P. Dale_, Nov 02 2015 *)

%o (PARI) { for (n=0, 1000, if (n, a=(-1)^primepi(n), a=1); write("b065357.txt", n, " ", a) ) } \\ _Harry J. Smith_, Sep 30 2009

%Y Cf. A000720, A065358.

%K easy,sign

%O 0,1

%A _Jason Earls_, Oct 31 2001

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 March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)