import FormalConjecturesUtil
/-!
# Numbers $n$ such that the perfect deficiency of $n$ is $\le 10$.
We formally define the property satisfied by elements of the sequence,
using the sum of divisors function $\sigma_1(n)$.
*References:*
- [A108864](https://oeis.org/A108864)
-/
namespace OeisA108864
open Nat Finset Int
/--
The condition for a number $n$ to be in the sequence.
It satisfies $0 < n$ and its perfect deficiency is $\le 10$, using the sum of divisors
function $\sigma_1(n)$.
-/
def A (n : ℕ) : Prop :=
let sigmaOneN : ℕ := (Nat.divisors n).sum id
0 < n ∧ ((sigmaOneN : ℤ) - 2 * (n : ℤ)).natAbs ≤ 10
instance : DecidablePred A := by
unfold A
infer_instance
/--
The primary defining sequence `a`.
`a n` is the `n`-th number (0-indexed) such that its perfect deficiency is $\le 10$.
-/
noncomputable def a (n : ℕ) : ℕ :=
n.nth A
/-- An explicit collection of 59 members preceding the counterexample. -/
private def earlierTerms : Finset ℕ :=
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20, 21, 22, 26,
28, 32, 40, 44, 50, 52, 56, 64, 68, 70, 88, 104, 110, 128, 130, 136, 152,
184, 196, 256, 315, 368, 464, 496, 512, 592, 650, 656, 836, 884, 1012,
1024, 1155, 1696, 1888, 1952, 2048, 2144, 2272}
set_option maxRecDepth 10000 in
set_option maxHeartbeats 2000000 in
/--
The odd number `442365 = 1155 * 383` has divisor sum `884736`, so its
perfect deficiency has absolute value 6. There are at least 59 members
of the sequence below it, contradicting the proposed parity assertion.
-/
theorem conjecture.disproof :
¬ (∀ n > 58, Even (a n)) := by
have hsum : (Nat.divisors 442365).sum id = 884736 := by
change (Nat.divisors (1155 * 383)).sum (fun d => d) = _
rw [Nat.Coprime.sum_divisors_mul (by norm_num : Nat.Coprime 1155 383)]
rw [Nat.Prime.divisors (by norm_num : Nat.Prime 383)]
have hsmall : (Nat.divisors 1155).sum (fun d => d) = 2304 := by decide
rw [hsmall]
norm_num
have hmem : A 442365 := by
unfold A
rw [hsum]
norm_num
have hcard : earlierTerms.card = 59 := by decide
have hearlier : ∀ m ∈ earlierTerms, m < 442365 ∧ A m := by decide +kernel
have hcount : 59 ≤ Nat.count A 442365 := by
rw [Nat.count_eq_card_filter_range, ← hcard]
apply Finset.card_le_card
intro m hm
exact Finset.mem_filter.mpr
⟨Finset.mem_range.mpr (hearlier m hm).1, (hearlier m hm).2⟩
have hnth : a (Nat.count A 442365) = 442365 := Nat.nth_count hmem
intro h
have heven := h (Nat.count A 442365) (by omega)
rw [hnth] at heven
norm_num at heven
end OeisA108864
An AI agent produced a Lean proof of the negation of
OeisA108864.conjecturefor about$0.41 of API spend, which is unrealistically low for a research-open conjecture from the
OEIS set.
AI review of the accepted proof suggests the statement is misformalized, in the following way (AI-written):
The accepted Lean proof