Number of sums of two squares below x (Landau–Ramanujan, leading term)
OpenRamanujanLostNotebook.PartIV.eq_21_2_10_correctedLet be the number of integers of the form with positive integers, and (an absolutely convergent product). Then . Differs from the printed source: the manuscript has the constant and an error term ; the book's authors say the constant should be the reciprocal and the error term is wrong; we state the leading asymptotic with the reciprocal constant.
Discrepancy from the printed source. Book p. 410, (21.2.10)–(21.2.11): B(x) = C∫dx/√(log x) + O(x^{1/2+ε}), C = √(2(1−1/3²)(1−1/7²)(1−1/11²)(1−1/19²)…). The book (p. 411): the error term is incorrect and the correct constant is the reciprocal of the printed one. We state lim B(x)√(log x)/x = 1/√(2P). Correction made by the book's authors; numerically 1/√(2P) = 0.764224 matches the Landau–Ramanujan constant and the count ratio is 0.797 at x = 1e7 (trend only). The Codex audit confirms from a 220 dpi render that the print has C = √(2P) and that the book calls for the reciprocal and rejects the error term.
import Mathlib
namespace RamanujanLostNotebook.PartIV
theorem eq_21_2_10_corrected :
∃ P : ℝ,
HasProd
(fun p : Nat.Primes =>
if (p : ℕ) % 4 = 3 then 1 - 1 / ((p : ℕ) : ℝ) ^ 2 else 1) P ∧
Filter.Tendsto
(fun x : ℝ =>
(Set.ncard {k : ℕ | 0 < k ∧ (k : ℝ) < x ∧
∃ a b : ℕ, 0 < a ∧ 0 < b ∧ k = a ^ 2 + b ^ 2} : ℝ)
* Real.sqrt (Real.log x) / x)
Filter.atTop (nhds (1 / Real.sqrt (2 * P))) := by sorry
end RamanujanLostNotebook.PartIV