Why is $i$ here?

116 Views Asked by At

So I was trying to put $$\sum_{n=2}^\infty\frac{(-1)^n}{\pi(n)}$$(where $\pi(n)$ is the prime counting function) into Wolfram Alpha. It didn't work. So I decided to replace $\pi(n)$ with $\ln n$. I got this. But what's "i" doing here? (I couldn't add LaTeX or the post will look weird). I have no idea why Wolfram Alpha did this. Surely ln n will never be imaginary in the realm of numbers greater than 2, am I right?

enter image description here

1

There are 1 best solutions below

1
On BEST ANSWER

Error estimates for these types of sums are often obtained by relating the sum to an integral which is then evaluated numerically. That introduces numerical error which can produce a very small imaginary portion.

You can enter the prime counting function $\pi(n)$ into WolframAlpha as

primepi(n)

Thus, the following should estimate your desired sum:

sum (-1)^n/primepi(n), n=2..inf

I guess it's pretty easy to see that the answer should be 1 but we again see the numerical error.