/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilRatio 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:
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 / denSequence 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 := ⊢ a 0 = 1 All goals completed! 🐙
Value of the sequence a at 1.
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := ⊢ a 1 = 1 All goals completed! 🐙
Value of the sequence a at 2.
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := ⊢ a 2 = 1 All goals completed! 🐙
Value of the sequence a at 3.
@[category test, AMS 11]
theorem a_3 : a 3 = 1 := ⊢ a 3 = 1 All goals completed! 🐙
Value of the sequence a at 4.
@[category test, AMS 11]
theorem a_4 : a 4 = 1 := ⊢ a 4 = 1 All goals completed! 🐙Conjecture (1): $a(n)$ is always an integer (the denominator divides the numerator).
Answer: true, see linked proof.
@[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) := n:ℕhn:0 < n⊢ ∏ k ∈ Finset.Icc 1 n, (n / k).factorial ^ k ∣ ∏ j ∈ Finset.Icc 1 n, ∏ k ∈ Finset.Icc 1 n, j.gcd k
All goals completed! 🐙Conjecture (2): If $p$ is a prime, then $p \mid a(n)$ if and only if $p \le n/3$.
Answer: true, see linked proof.
@[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 := n:ℕp:ℕhn:0 < nhp:Nat.Prime p⊢ (∃ m, a n = ↑m ∧ p ∣ m) ↔ p ≤ n / 3
All goals completed! 🐙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))$.
Answer: true, see linked proof.
@[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)) := n:ℕp:ℕk:ℕhn:0 < nhp:Nat.Prime phk:k < p⊢ padicValRat p (a (n * p)) = padicValRat p (a (n * p + k))
All goals completed! 🐙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)$.
Answer: true, see linked proof.
@[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) : ℤ) := n:ℕp:ℕhn:0 < nhp:Nat.Prime p⊢ padicValRat p (a (n * p)) = ∑' (i : ℕ), ↑(b (n / p ^ i))
All goals completed! 🐙end OeisA129365