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!)
A219071 Parity of pi(10^n). 3
0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
COMMENTS
The parity of pi(n) is obtained without calculating pi(n), and much more quickly. See the paper below.
LINKS
Henri Lifchitz, Parity of pi(n)
EXAMPLE
For n = 3, pi(10^3) = 168 = 0 (mod 2).
MATHEMATICA
Table[Mod[PrimePi[10^n], 2], {n, 0, 10}] (* T. D. Noe, Nov 13 2012 *)
PROG
(PARI) sq(n)=if (n<6, return(max(n-1, 0))); my(s, t); forsquarefree(i=1, sqrtint(n), t=n\i[1]^2; s+=moebius(i)*sum(i=1, sqrtint(t), t\i)); s;
a(n)=my(s, N=10^n); forsquarefree(i=1, logint(N, 2), s += moebius(i)*sq(sqrtnint(N, i[1]))); s%2 \\ Charles R Greathouse IV, Jan 10 2018
CROSSREFS
Sequence in context: A144606 A060510 A327205 * A072629 A164292 A337802
KEYWORD
nonn
AUTHOR
Henri Lifchitz, Nov 11 2012
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 25 10:01 EDT 2024. Contains 371967 sequences. (Running on oeis4.)