Title:Period of -th powers modulo
Statement:Conjecture: let be the length of the period of the sequence where is a prime, then if , else .
A formal proof has been found with the methods described in arxiv/2605.22763.
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Tags: | formal_proof |
| Cite as: | NS.06103 [math.NT] · NS.06103v1 for this version |
| Declaration: | OeisA282779.periodOfPowerMod_eq |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60 |
| Statement hash: | fbb96501b9340315c0334013798fafda4fb15165319e0ae275f08ef4c6ea57b2 |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/OEIS/282779.lean |
Formal statement
theorem periodOfPowerMod_eq (p n : ℕ) (hp : Nat.Prime p) (hn : n > 0) :
periodOfPowerMod p n = if p ^ 2 ∣ n then n / p else nShow the full Challenge.lean (94 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# Period of $p$-th powers modulo $n$
a: Period of cubes mod $n$.
The $n$-th term $a(n)$ is the smallest positive integer $T$ such that
$\forall k \in \mathbb{N}$, $(k+T)^3 \equiv k^3 \pmod n$.
The length of the minimal positive period of the sequence $k^p \pmod n$.
$a_p(n) = \min \{ T \in \mathbb{N}^+ \mid \forall k \in \mathbb{N}, (k+T)^p \equiv k^p \pmod n \}$.
*References:*
- [A282779](https://oeis.org/A282779)
- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven Formal Proof Search* by George Tsoukalas et al.
-/
@[expose] public section
namespace OeisA282779
open Nat Set
/--
Period of cubes mod $n$.
The $n$-th term $a(n)$ is the smallest positive integer $T$ such that
$\forall k \in \mathbb{N}$, $(k+T)^3 \equiv k^3 \pmod n$.
-/
noncomputable def a (n : ℕ) : ℕ :=
if n = 0 then 0 -- Handle the non-sequence index n=0
else
-- sInf computes the infimum of the set, which is the minimum since ℕ is well-ordered.
sInf { T : ℕ | 0 < T ∧ ∀ k : ℕ, (k + T) ^ 3 % n = k ^ 3 % n }
/--
The length of the minimal positive period of the sequence $k^p \pmod n$.
$a_p(n) = \min \{ T \in \mathbb{N}^+ \mid \forall k \in \mathbb{N}, (k+T)^p \equiv k^p \pmod n \}$.
-/
noncomputable def periodOfPowerMod (p n : ℕ) : ℕ :=
if n = 0 then 0
else
sInf { T : ℕ | 0 < T ∧ ∀ k : ℕ, (k + T) ^ p % n = k ^ p % n }
set_option linter.style.formal_proof_palomar false in
/--
Conjecture: let $a_p(n)$ be the length of the period of the sequence $k^p \bmod n$ where $p$ is a prime, then $a_p(n) = n/p$ if $n \equiv 0 \pmod{p^2}$, else $a_p(n) = n$.
A formal proof has been found with the methods described in
[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).
-/
@[category research solved, AMS 11, formal_proof using formal_conjectures at
"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/282779.wip.lean#L104"]
theorem periodOfPowerMod_eq (p n : ℕ) (hp : Nat.Prime p) (hn : n > 0) :
periodOfPowerMod p n = if p ^ 2 ∣ n then n / p else n := by
sorry
@[category test, AMS 11]
lemma a_1 : a 1 = 1 := by exact periodOfPowerMod_eq 3 1 (by decide) (by decide)
@[category test, AMS 11]
lemma a_2 : a 2 = 2 := by exact periodOfPowerMod_eq 3 2 (by decide) (by decide)
@[category test, AMS 11]
lemma a_3 : a 3 = 3 := by exact periodOfPowerMod_eq 3 3 (by decide) (by decide)
@[category test, AMS 11]
lemma a_4 : a 4 = 4 := by exact periodOfPowerMod_eq 3 4 (by decide) (by decide)
@[category test, AMS 11]
lemma a_5 : a 5 = 5 := by exact periodOfPowerMod_eq 3 5 (by decide) (by decide)
end OeisA282779
To prove it: keep every definition of Challenge.lean unchanged and prove OeisA282779.periodOfPowerMod_eq with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_periodOfPowerMod_eq : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry fetch oeis-282779 nosorry submit oeis-282779 nosorry/oeis-282779/Solution.lean --wait
Contributions
No contributions yet — be the first. Submit a proof or a finding.
Research in progress
People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.
Nobody has shared research on this problem yet.
Sign in to share your research.
Statement review
Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.
Sign in to open a critique.