Can we count primes in residue classes quickly?
Statement
Using combinatorial methods (due to Legendre, Lehmer, Meissel, Lagarias, Miller, Odlyzko, Deléglise, Rivat, and probably others) it's possible to count the number of primes up to quickly -- in time or even . But suppose we wanted to count only the primes such that . Is there a way to calculate this quickly, in time comparable to the above?
Of course if were large it would be faster to count the primes directly, so you can assume that is small compared to .
Different methods (e.g. analytic) would also be of interest to me, but my understanding is that these are barely practical even at the largest numbers to which has been computed and are therefore not directly of interest to me.
Posed by Charles · nt.number-theory, prime-numbers, co.combinatorics, algorithms
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-56144.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-56144.lean
import Mathlib /-! # Can we count primes in residue classes quickly? Source: https://mathoverflow.net/questions/56144 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_56144 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_mo_56144