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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Sums of four binary palindromes

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

Every number is the sum of four binary palindromes, i.e., a(n)>0a(n) > 0 for all nn. Originally stated as a conjecture on OEIS; proved by Rajasekaran, Shallit, and Smith (2017).

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

Formal statement

theorem conjecture (n : ℕ) : 0 < a n
Show the full Challenge.lean (78 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Sums of four binary palindromes

Number of ordered quadruples $(u, v, w, x)$ of binary palindromes (see A006995) with
$u + v + w + x = n$.

*References:*
- [A261680](https://oeis.org/A261680)
- [Sums of Palindromes: an Approach via Nested-Word Automata](https://arxiv.org/abs/1706.10206)
  by *Aayush Rajasekaran*, *Jeffrey Shallit*, and *Tim Smith*, arXiv:1706.10206 (2017)
-/

@[expose] public section

namespace OeisA261680

/-- Whether $k$ is a binary palindrome (A006995). -/
def isBinaryPalindrome (k : ℕ) : Bool :=
  (Nat.digits 2 k).reverse == Nat.digits 2 k

/--
The number of ordered quadruples $(u, v, w, x)$ of binary palindromes with $u + v + w + x = n$.
-/
def a (n : ℕ) : ℕ :=
  ∑ u ∈ Finset.range (n + 1),
    ∑ v ∈ Finset.range (n - u + 1),
      ∑ w ∈ Finset.range (n - (u + v) + 1),
        let x := n - (u + v + w)
        if isBinaryPalindrome u &&
           isBinaryPalindrome v &&
           isBinaryPalindrome w &&
           isBinaryPalindrome x
        then 1 else 0

@[category test, AMS 11]
theorem a_0 : a 0 = 1 := by rfl

@[category test, AMS 11]
theorem a_1 : a 1 = 4 := by rfl

@[category test, AMS 11]
theorem a_2 : a 2 = 6 := by rfl

@[category test, AMS 11]
theorem a_3 : a 3 = 8 := by rfl

@[category test, AMS 11]
theorem a_4 : a 4 = 13 := by rfl

/--
Every number is the sum of four binary palindromes, i.e., $a(n) > 0$ for all $n$.
Originally stated as a conjecture on OEIS; proved by Rajasekaran, Shallit, and Smith (2017).
-/
@[category research solved, AMS 11]
theorem conjecture (n : ℕ) : 0 < a n := by
  sorry

end OeisA261680

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

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