# Legendre's Constant

In a couple of web pages, I see that Legendre's constant is defined to be $\lim_{n \to \infty} (\pi(n) - (n/\log(n)))$ (for example, here and here).

Actually the first uses $\lim_{n \to \infty} (\log(n) - (n/\pi(n)))$, but I have the same question in either case.

To be honest, I just assumed that this was a typo for $\lim_{n \to \infty} (\pi(n) / (n/\log(n)))$ (that is, the prime number theorem). However, in both pages it looks to me as if the claim really is that $\lim_{n \to \infty} (\pi(n) - (n/\log(n)))$ exists and is $1$. Really?

I don't know whether to be more surprised that the limit exists or that its value is 1

Does anyone else find it surprising?

• of course $f(n)=\pi(n) - (n/\log(n))$ does not have a limit, since $f(n+1)-f(n)$ does not have a limit – Fedor Petrov Jun 29 '17 at 19:29
• @JoséHdz.Stgo. Would you care to elaborate what did “Wikipedians get wrong”? I don’t see anything wrong at either en.wikipedia.org/wiki/File:Legendre%27s_constant.svg or en.wikipedia.org/wiki/Legendre%27s_constant . Wikipedia is not mentioned at the page you link to, nor does it seem to contradict it. – Emil Jeřábek Jul 6 '17 at 15:39
• @EmilJeřábek: I stand corrected. – José Hdz. Stgo. Jul 6 '17 at 17:07
• So just to summarize: $$\lim_{n \to \infty} (log(n) - (n/\pi(n)))$$ exists and is equal to $1$, whereas: $$\lim_{n \to \infty} (\pi(n) - (n/log(n)))$$ does not exist. I am still surprised at the former - it seems a better convergence than could be expected, but GH shows below how it comes about! – user304582 Jul 10 '17 at 22:30

1. The prime number theorem in the form $$\pi(n)=\mathrm{li}(n)+O(ne^{-c\sqrt{\log n}})$$ combined with the approximation $$\mathrm{li}(n)=\frac{n}{\log n}+\frac{n}{\log^2 n}+O\left(\frac{n}{\log^3 n}\right)$$ shows that $$\pi(n)-\frac{n}{\log n}=\frac{n}{\log^2 n}+O\left(\frac{n}{\log^3 n}\right).$$ So the left hand side tends to infinity quite rapidly, it has no finite limit.

2. The correct definition of Legendre's constant is $$A:=\lim_{n\to\infty}\left(\log n-\frac{n}{\pi(n)}\right),$$ and the third display above shows that it equals $1$: \begin{align*}\log n-\frac{n}{\pi(n)} &=\log n-\frac{n}{\frac{n}{\log n}+\frac{n+o(n)}{\log^2 n}}\\ &=\log n-\frac{\log n}{1+\frac{1+o(1)}{\log n}}\\ &=(\log n)\left(1-\frac{1}{1+\frac{1+o(1)}{\log n}}\right)\\ &=(\log n)\left(1-1+\frac{1+o(1)}{\log n}\right)\\ &=(\log n)\frac{1+o(1)}{\log n}\\ &=1+o(1).\end{align*}

I'll stay clear from the infamous $B_L'$ notation.

Legendre's original (correct) statement is that

$$\pi(x)=\frac{Bx}{\log x-A+o(1)}$$

where the so-called "Legendre's constant" is $A$. The incorrect part was that he guessed that $A=1.08366$

As pointed out by Fedor Petrov, the definition with $\pi(n) - (n/\log(n))$ is clearly wrong.

Note. Using de la Vallée Poussin to disprove Legendre's conjecture is actually an overkill. This elementary argument is due to Pintz.

Let

$$\Psi(x)=Cx+\frac{(D+o(1))x}{\log x}$$

with some constants $C$ and $D$. Using Stirling and Legendre's formula,

\begin{equation*} \begin{split} \log x+O(1) &= \frac{\log [x]!}{x}=\frac{1}{x} \sum_{n\leq x} \Lambda (n) \left[ \frac{x}{n} \right]\\ & = \sum_{n\leq x} \frac{\Lambda (n)}{n}+\frac{1}{x} \sum_{n\leq x} \Lambda (n)O(1)\\ & = \int_2^x \frac{\Psi(t)}{t^2}dt+\frac{\Psi(x)}{x}+O\left( \frac{\Psi(x)}{x}\right)\\ & = \int_2^x \frac{C+\frac{D+o(1)}{\log t}}{t}dt+O(1)\\ & = C\log x + (D+o(1))\log\log x. \end{split} \end{equation*}

Therefore $C=1$ and $D=0$, that is,

$$\Psi(x)=x\left(1+\frac{o(1)}{\log x}\right).$$

And by partial summation we finally get $A=B=1$ in Legendre's formula.

• Wait... legendres conjecture is known to be false? D: I love trying to come up with tactics to prove it. Thanks for ruining the fun. – The Great Duck Jun 30 '17 at 2:42
• @Typhon The conjecture is true, it's just that $A=1$ exactly. – Wojowu Jun 30 '17 at 7:39
• @Typhon no the same "Legrende's conjecture", I think... This is not the same one as in Landau's problems. – Myshkin Jun 30 '17 at 13:09
• @Wojowu the conjecture is the formula? I thought we were referring to the whole "primes between any two squares" thing. – The Great Duck Jun 30 '17 at 16:18
• @Typhon We are talking about a completely different here. – Wojowu Jun 30 '17 at 16:19