The mean e-th power residue modulo any n, formalized in Lean

For integers e, n ≥ 1 let S_e(n) be the mean of the least residues of the e-th powers modulo n, and let s_e(n) be the number of k modulo n with n | k^e. We prove that S_e(n) = (n − s_e(n))/2 + Σ_ψ B_{1,ψ} W_n(ψ), where ψ runs over the odd primitive Dirichlet characters with ψ^e = 1 whose conductor divides n, B_{1,ψ} is the first generalized Bernoulli number, and W_n(ψ) is an explicit product of local weights built from the values ψ(p) at the primes p | n. For e = 2 this is the classical formula for the mean quadratic residue through Hurwitz class numbers (the case a = 1 of a proposition of Skoruppa and Zagier). For odd e the sum is empty and S_e(n) = (n − s_e(n))/2. For prime moduli the evaluation is classical. We found no statement for e ≥ 3 and composite n in the literature, and make no claim of priority. The proof is elementary: it counts e-th roots one prime power at a time and uses only the orthogonality of characters. The note gives worked values for fourth powers. It is the companion note of the Lean 4 / Mathlib formalization MeanPowerResidue (doi:10.5281/zenodo.24616951). That formalization has no hypotheses and quotes nothing, and Lean's comparator checks it under three independent kernels.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-28
DOI
https://doi.org/10.5281/zenodo.24617087
Primary Topic
Analytic Number Theory Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

The mean e-th power residue modulo any n, formalized in Lean

Joseph S. Farland
Zenodo (CERN European Organization for Nuclear Research)
Analytic Number Theory Research
preprint

The mean e-th power residue modulo any n, formalized in Lean

Joseph S. Farland
preprint en

Abstract

For integers e, n ≥ 1 let S_e(n) be the mean of the least residues of the e-th powers modulo n, and let s_e(n) be the number of k modulo n with n | k^e. We prove that S_e(n) = (n − s_e(n))/2 + Σ_ψ B_{1,ψ} W_n(ψ), where ψ runs over the odd primitive Dirichlet characters with ψ^e = 1 whose conductor divides n, B_{1,ψ} is the first generalized Bernoulli number, and W_n(ψ) is an explicit product of local weights built from the values ψ(p) at the primes p | n. For e = 2 this is the classical formula for the mean quadratic residue through Hurwitz class numbers (the case a = 1 of a proposition of Skoruppa and Zagier). For odd e the sum is empty and S_e(n) = (n − s_e(n))/2. For prime moduli the evaluation is classical. We found no statement for e ≥ 3 and composite n in the literature, and make no claim of priority. The proof is elementary: it counts e-th roots one prime power at a time and uses only the orthogonality of characters. The note gives worked values for fourth powers. It is the companion note of the Lean 4 / Mathlib formalization MeanPowerResidue (doi:10.5281/zenodo.24616951). That formalization has no hypotheses and quotes nothing, and Lean's comparator checks it under three independent kernels.

Zenodo (CERN European Organization for Nuclear Research)
Analytic Number Theory Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon