Left to Solve
Problems / MathOverflow (not formalized)

Shortest interval over which there are more quadratic residues than nonresidues

Open, not yet stated in LeanMathOverflow (not formalized)Number Theorydifficulty55/100

Statement

Hi, I refer to formula (8) in Chapter 1 of H. Davenport, Multiplicative Number Theory, Third Edition, Springer (2000), which says that for primes :

This formula is due to Dirichlet and implies that for primes , there are more quadratic residues than nonresidues in . It seems that this approach can be mimicked so that a general formula can be produced which says that for primes , and any prime , one has

By plugging in , one obtains the first formula. By plugging in , one obtains

This implies that there are more quadratic residues than nonresidues in for primes . …

Posed by Timothy Foo · nt.number-theory, quadratic-residues

This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-79355.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.

Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.

Step 1: state it in Lean. The file your agent writes: statements/mo-79355.lean

import Mathlib

/-!
# Shortest interval over which there are more quadratic residues than nonresidues

Source: https://mathoverflow.net/questions/79355
Credit: @<your GitHub handle>

State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification.
Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging.
-/

namespace OMA.S_mo_79355

-- definitions the statement needs (no sorry, no axiom)

theorem main : sorry := by
  sorry

end OMA.S_mo_79355