# Legendre's constant

Legendre's constant is a mathematical constant occurring in a formula constructed by Adrien-Marie Legendre to approximate the behavior of the prime-counting function $\pi (x)$. The value that corresponds precisely to its asymptotic behavior is now known to be 1.
Examination of available numerical data for known values of $\pi (x)$ led Legendre to an approximating formula.
Legendre proposed in 1808 the formula $y={\frac {x}{\log(x)-1.08366}},$ (OEIS: A228211), as giving an approximation of $y=\pi (x)$ with a "very satisfying precision".
Today, one defines the real constant $B$ by $\pi (x)\sim {\frac {x}{\log(x)-B}},$ which is solved by putting $B=\lim _{n\to \infty }\left(\log(n)-{n \over \pi (n)}\right),$ provided that this limit exists.
Not only is it now known that the limit exists, but also that its value is equal to 1, somewhat less than Legendre's 1.08366. Regardless of its exact value, the existence of the limit $B$ implies the prime number theorem.
Pafnuty Chebyshev proved in 1849 that if the limit B exists, it must be equal to 1. An easier proof was given by Pintz in 1980.
It is an immediate consequence of the prime number theorem, under the precise form with an explicit estimate of the error term
$\pi (x)=\operatorname {Li} (x)+O\left(xe^{-a{\sqrt {\log x}}}\right)\quad {\text{as }}x\to \infty$
(for some positive constant a, where O(...) is the big O notation), as proved in 1899 by Charles de La Vallée Poussin, that B indeed is equal to 1. (The prime number theorem had been proved in 1896, independently by Jacques Hadamard and La Vallée Poussin,$^{:183–256,281–361}$ but without any estimate of the involved error term).
Being evaluated to such a simple number has made the term Legendre's constant mostly only of historical value, with it often (technically incorrectly) being used to refer to Legendre's first guess 1.08366... instead.

## Numerical values

Using known values for $\pi (x)$, we can compute $B(x)=\log x-{\frac {x}{\pi (x)}}$ for values of $x$ far beyond what was available to Legendre:
Legendre's constant asymptotically approaching 1 for large values of $x$ :
| x | B(x) | x | B(x) | x | B(x) | x | B(x) |
| 10$^2$ | 0.605170 | 10$^{16}$ | 1.029660 | 10$^{30}$ | 1.015148 | 10$^{44}$ | 1.010176 |
| 10$^3$ | 0.955374 | 10$^{17}$ | 1.027758 | 10$^{31}$ | 1.014637 | 10$^{45}$ | 1.009943 |
| 10$^4$ | 1.073644 | 10$^{18}$ | 1.026085 | 10$^{32}$ | 1.014159 | 10$^{46}$ | 1.009720 |
| 10$^5$ | 1.087571 | 10$^{19}$ | 1.024603 | 10$^{33}$ | 1.013712 | 10$^{47}$ | 1.009507 |
| 10$^6$ | 1.076332 | 10$^{20}$ | 1.023281 | 10$^{34}$ | 1.013292 | 10$^{48}$ | 1.009304 |
| 10$^7$ | 1.070976 | 10$^{21}$ | 1.022094 | 10$^{35}$ | 1.012897 | 10$^{49}$ | 1.009108 |
| 10$^8$ | 1.063954 | 10$^{22}$ | 1.021022 | 10$^{36}$ | 1.012525 | 10$^{50}$ | 1.008921 |
| 10$^9$ | 1.056629 | 10$^{23}$ | 1.020050 | 10$^{37}$ | 1.012173 | 10$^{51}$ | 1.008742 |
| 10$^{10}$ | 1.050365 | 10$^{24}$ | 1.019164 | 10$^{38}$ | 1.011841 | 10$^{52}$ | 1.008569 |
| 10$^{11}$ | 1.045126 | 10$^{25}$ | 1.018353 | 10$^{39}$ | 1.011527 | 10$^{53}$ | 1.008403 |
| 10$^{12}$ | 1.040872 | 10$^{26}$ | 1.017607 | 10$^{40}$ | 1.011229 | 10$^{54}$ | 1.008244 |
| 10$^{13}$ | 1.037345 | 10$^{27}$ | 1.016921 | 10$^{41}$ | 1.010946 | 10$^{55}$ | 1.008090 |
| 10$^{14}$ | 1.034376 | 10$^{28}$ | 1.016285 | 10$^{42}$ | 1.010676 | 10$^{56}$ | 1.007942 |
| 10$^{15}$ | 1.031844 | 10$^{29}$ | 1.015696 | 10$^{43}$ | 1.010420 | 10$^{57}$ | 1.007799 |
Values up to $\pi (10^{29})$ (the first two columns) are known exactly; the values in the third and fourth columns are estimated using the Riemann R function.