Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Ratio of product of GCDs to product of factorials of floor divisions · conjecture2

Source:OEIS conjectures
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Conjecture (2): If pp is a prime, then p∣a(n)p \mid a(n) if and only if p≤n/3p \le n/3.

Proof summary:

We use the formula shown above: ord(a(n),p)=∑r≥1b(⌊n/pr⌋)\textrm{ord}(a(n), p) = \sum_{r \geq 1} b(\lfloor n/p^r \rfloor) where b(m)=∑k=1mm mod kb(m) = \sum_{k=1}^m m \textrm{ mod } k.

If p∣a(n)p ∣ a(n) then b(⌊n/pr⌋)≥1b(\lfloor n/p^r \rfloor) ≥ 1 for some r≥1r ≥ 1. Since b(m) = 0$ for m≤2m \leq 2, we must have n/pr≥3n / p^r \geq 3. If the inequality holds for r≥1r \geq 1, it must be true for r=1r = 1. Hence n≥3pn \geq 3p, proving the conjecture.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:formal_proof
Cite as:NS.04914 [math.NT] · NS.04914v1 for this version
Declaration:OeisA129365.conjecture2
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:b0cca385e5013c55d5bd5e7fc857731c859e27a6ea0662399874beec964c5a74
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/129365.lean

Formal statement

theorem conjecture2 (n p : ℕ) (hn : 0 < n) (hp : p.Prime) :
    (∃ m : ℕ, a n = m ∧ p ∣ m) ↔ p ≤ n / 3
Show the full Challenge.lean (154 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Ratio of product of GCDs to product of factorials of floor divisions

$$a(n) = \frac{\prod_{j=1}^n \prod_{k=1}^n \gcd(j,k)}{\prod_{k=1}^n (\lfloor n/k \rfloor!)^k}$$

*References:*
- [A129365](https://oeis.org/A129365)
-/

@[expose] public section

namespace OeisA129365

/-- $a(n) = \frac{\prod_{j=1}^n \prod_{k=1}^n \gcd(j,k)}{\prod_{k=1}^n (\lfloor n/k \rfloor!)^k}$. -/
def a (n : ℕ) : ℚ :=
  let num : ℚ := (Finset.Icc 1 n).prod fun j => (Finset.Icc 1 n).prod fun k => Nat.gcd j k
  let den : ℚ := (Finset.Icc 1 n).prod fun k => (n / k).factorial ^ k
  num / den

/-- Sequence A004125: sum of remainders $n \bmod k$ for $1 \le k \le n$. -/
def b (n : ℕ) : ℕ :=
  ∑ k ∈ Finset.Icc 1 n, (n % k)

/-- Value of the sequence `a` at 0. -/
@[category test, AMS 11]
theorem a_0 : a 0 = 1 := by decide +native

/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by decide +native

/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by decide +native

/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 1 := by decide +native

/-- Value of the sequence `a` at 4. -/
@[category test, AMS 11]
theorem a_4 : a 4 = 1 := by decide +native

set_option linter.style.formal_proof_palomar false in
/--
Conjecture (1): $a(n)$ is always an integer (the denominator divides the numerator).

Proof summary:

Let $c(n) = \prod_{j=1}^n \prod_{k=1}^n (j,k)$ be the numerator.
Observe that
$$\textrm{ord}(c(n), p) = \left\lfloor \frac{n}{p} \right\rfloor^2 + \left\lfloor \frac{n}{p^2} \right\rfloor^2 + ...$$
proven similar to Legendre's formula for $\textrm{ord}(n!, p)$.

Next let $d(n) = \prod_{k=1}^n (\lfloor n/k \rfloor!)^k$ be the denominator.
Observe that
$$\textrm{ord}(d(n), p) = \sum_{k=1}^n k\,\textrm{ord}(\lfloor n/k \rfloor, p) = \sum_{k=1}^n \sum_{r \geq 1} k \left\lfloor \frac{\lfloor n/p^r \rfloor}{k} \right\rfloor.$$

Combining the two gives:
$$\textrm{ord}(a(n), p) = \sum_{r \geq 1} \sum_{k=1}^n \left(\left\lfloor \frac{n}{p^r} \right\rfloor \textrm{mod } k\right).$$

Defining $b(m) = \sum_{k=1}^m m \textrm{ mod } k$, we obtain $\textrm{ord}(a(n), p) = \sum_{r \geq 1} b(\lfloor n/p^r \rfloor)$.

As $b(m) \geq 0$, $\textrm{ord}(a(n), p)$ is non-negative for any $p$, so $a(n)$ is an integer.
-/
@[category research solved, AMS 11,
  formal_proof using lean4 at
    "https://github.com/KitaKen1/oeis-a129365-conjectures/blob/9c0201540c337733d6b8afb2aff209f5489c122a/lean/OeisA129365FC.lean#L234-L395"]
theorem conjecture1 (n : ℕ) (hn : 0 < n) :
    ((Finset.Icc 1 n).prod fun k => (n / k).factorial ^ k) ∣
      ((Finset.Icc 1 n).prod fun j => (Finset.Icc 1 n).prod fun k => Nat.gcd j k) := by
  sorry

set_option linter.style.formal_proof_palomar false in
/--
Conjecture (2): If $p$ is a prime, then $p \mid a(n)$ if and only if $p \le n/3$.

Proof summary:

We use the formula shown above:
$\textrm{ord}(a(n), p) = \sum_{r \geq 1} b(\lfloor n/p^r \rfloor)$ where
$b(m) = \sum_{k=1}^m m \textrm{ mod } k$.

If $p ∣ a(n)$ then $b(\lfloor n/p^r \rfloor) ≥ 1$ for some $r ≥ 1$. Since b(m) = 0$ for $m \leq 2$,
we must have $n / p^r \geq 3$. If the inequality holds for $r \geq 1$, it must be true for $r = 1$.
Hence $n \geq 3p$, proving the conjecture.
-/
@[category research solved, AMS 11,
  formal_proof using lean4 at
    "https://github.com/KitaKen1/oeis-a129365-conjectures/blob/9c0201540c337733d6b8afb2aff209f5489c122a/lean/OeisA129365FC.lean#L234-L395"]
theorem conjecture2 (n p : ℕ) (hn : 0 < n) (hp : p.Prime) :
    (∃ m : ℕ, a n = m ∧ p ∣ m) ↔ p ≤ n / 3 := by
  sorry

set_option linter.style.formal_proof_palomar false in
/--
Conjecture (3): For each positive integer $n$, prime $p$, and $0 \le k < p$,
$\mathrm{ord}_p(a(np)) = \mathrm{ord}_p(a(np + k))$.

Proof summary:

This follows from the formula shown above:
$\textrm{ord}(a(n), p) = \sum_{r \geq 1} b(\lfloor n/p^r \rfloor)$ where
$b(m) = \sum_{k=1}^m m \textrm{ mod } k$.

Since $k < p$, we have $\lfloor (np + k)/p^r \rfloor = \lfloor np/p^r \rfloor$ for every $r \geq 1$,
proving the claim.
-/
@[category research solved, AMS 11,
  formal_proof using lean4 at
    "https://github.com/KitaKen1/oeis-a129365-conjectures/blob/9c0201540c337733d6b8afb2aff209f5489c122a/lean/OeisA129365FC.lean#L234-L395"]
theorem conjecture3 (n p k : ℕ) (hn : 0 < n) (hp : p.Prime) (hk : k < p) :
    padicValRat p (a (n * p)) = padicValRat p (a (n * p + k)) := by
  sorry

set_option linter.style.formal_proof_palomar false in
/--
Conjecture (4): Let $b(n) = \mathrm{A004125}(n) = \sum_{k=1}^n (n \bmod k)$. Then
$\mathrm{ord}_p(a(np)) = \sum_{i \ge 0} b(\lfloor n/p^i \rfloor)$.

Proof summary:

This follows directly from the formula shown at the beginning:
$\textrm{ord}(a(n), p) = \sum_{r \geq 1} b(\lfloor n/p^r \rfloor)$ where
$b(m) = \sum_{k=1}^m m \textrm{ mod } k$.
-/
@[category research solved, AMS 11,
  formal_proof using lean4 at
    "https://github.com/KitaKen1/oeis-a129365-conjectures/blob/9c0201540c337733d6b8afb2aff209f5489c122a/lean/OeisA129365FC.lean#L234-L395"]
theorem conjecture4 (n p : ℕ) (hn : 0 < n) (hp : p.Prime) :
    padicValRat p (a (n * p)) = ∑' i : ℕ, (b (n / p ^ i) : ℤ) := by
  sorry

end OeisA129365

To prove it: keep every definition of Challenge.lean unchanged and prove OeisA129365.conjecture2 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_conjecture2 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch oeis-129365--conjecture2
nosorry submit oeis-129365--conjecture2 nosorry/oeis-129365--conjecture2/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.