/-
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 FormalConjecturesUtilErdős Problem 435
References:
[ErGr80] Erdős, P. and Graham, R., Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathematique (1980).
[HwSo24] W. Hwang and K. Song, The Frobenius problem for Numerical Semigroups generated by binomial coefficients. arXiv:2412.17882 (2024).
namespace Erdos435Let $n\in\mathbb{N}$ with $n\neq p^k$ for any prime $p$ and $k\geq 0$. What is the largest integer not of the form $$\sum_{1\leq i<n}c_i\binom{n}{i}$$ where the $c_i\geq 0$ are integers?
If $n=\prod p_k^{a_k}$ then the largest integer not of this form is $$\sum_k \left( \sum_{1\leq d\leq a_k}\binom{n}{p_k^d}\right)(p_k-1)-n.$$ This was first proved by Hwang and Song [HwSo24]. Independently this was found in the comment section by Peake and Cambie.
@[category research solved, AMS 5 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/1d7b3f00780b85ed0462e79a1cd5650ee9055655/src/v4.29.1/ErdosProblems/Erdos435.lean"]
theorem erdos_435 (n : ℕ) (hn : n ≠ 0)
(hpk : ∀ p k : ℕ, p.Prime → n ≠ p ^ k) :
IsGreatest
{m : ℤ | ¬ ∃ c : ℕ → ℕ, m = ∑ i ∈ Finset.Ico 1 n, (c i : ℤ) * (n.choose i : ℤ)}
((∑ p ∈ n.primeFactors,
(∑ d ∈ Finset.Icc 1 (n.factorization p), (n.choose (p ^ d) : ℤ)) * ((p : ℤ) - 1)) - n) := n:ℕhn:n ≠ 0hpk:∀ (p k : ℕ), Nat.Prime p → n ≠ p ^ k⊢ IsGreatest {m | ¬∃ c, m = ∑ i ∈ Finset.Ico 1 n, ↑(c i) * ↑(n.choose i)}
(∑ p ∈ n.primeFactors, (∑ d ∈ Finset.Icc 1 (n.factorization p), ↑(n.choose (p ^ d))) * (↑p - 1) - ↑n)
All goals completed! 🐙end Erdos435