/- 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. -/ module public import FormalConjecturesUtil /-! # Numerator - denominator in $n$-th harmonic number $a(n) = \text{numerator}(H_n) - \text{denominator}(H_n)$, where $H_n = 1 + 1/2 + \dots + 1/n$. *References:* - [A064169](https://oeis.org/A064169)-/ @[expose] public section namespace OeisA64169 /-- The $n$-th harmonic number $H_n = \sum_{k=1}^n \frac{1}{k}$ as a rational number. -/ def H (n : ℕ) : ℚ := ∑ k ∈ Finset.Icc 1 n, 1 / (k : ℚ) /-- $a(n) = \text{numerator}(H_n) - \text{denominator}(H_n)$. -/ def a (n : ℕ) : ℤ := (H n).num - (H n).den @[category test, AMS 11] theorem a_1 : a 1 = 0 := by decide +native @[category test, AMS 11] theorem a_2 : a 2 = 1 := by decide +native @[category test, AMS 11] theorem a_3 : a 3 = 5 := by decide +native @[category test, AMS 11] theorem a_4 : a 4 = 13 := by decide +native @[category test, AMS 11] theorem a_5 : a 5 = 77 := by decide +native set_option linter.style.formal_proof_palomar false in /-- "Conjecture: for $n > 2$, $n$ divides $a(n-2)$ if and only if $n$ is a prime. Checked up to 20000. - _Amiram Eldar_ and _Thomas Ordowski_, Jul 27 2019 This is false for the composite number $16843^2$.-/ @[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/epoch-research/LeanOpenProblems-results/blob/f02efd9a8c5fc6a735d2a90c33e24f7278ce0ffc/runs/oeis-full-50usd-ant-j0j0g4uzligm1k41/oeis_64169_conjecture_0/Submission/Spec.lean#L514"] theorem conjecture : ¬ ∀ (n : ℕ), 2 < n → ((n : ℤ) ∣ a (n - 2) ↔ n.Prime) := by sorry end OeisA64169