/- 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 FormalConjecturesUtil

Symmetry of digit sum differences $\operatorname{sign}(S_5(k) - S_1(k))$

a: $\mathrm{a}(n) = \sum_{k=0}^n \mathrm{sign}(\mathrm{A007953}(5k) - \mathrm{A007953}(k))$. $\mathrm{A007953}(n)$ is the digital sum of $n$ in base 10. The sequence is non-negative, so the sum over $\mathbb{Z}$ is converted to $\mathbb{N}$.

References:

namespace OeisA289411open Nat

a: $\mathrm{a}(n) = \sum_{k=0}^n \mathrm{sign}(\mathrm{A007953}(5k) - \mathrm{A007953}(k))$. $\mathrm{A007953}(n)$ is the digital sum of $n$ in base 10. The sequence is non-negative, so the sum over $\mathbb{Z}$ is converted to $\mathbb{N}$.

def a (n : ) : := let digital_sum_ten (m : ) : := (Nat.digits 10 m).sum (Finset.range (n + 1)).sum (fun k => Int.sign ((digital_sum_ten (5 * k) : ) - (digital_sum_ten k : ))) |>.toNat@[category test, AMS 11] lemma a_0 : a 0 = 0 := a 0 = 0 All goals completed! 🐙@[category test, AMS 11] lemma a_1 : a 1 = 1 := a 1 = 1 All goals completed! 🐙@[category test, AMS 11] lemma a_2 : a 2 = 0 := a 2 = 0 All goals completed! 🐙@[category test, AMS 11] lemma a_3 : a 3 = 1 := a 3 = 1 All goals completed! 🐙@[category test, AMS 11] lemma a_4 : a 4 = 0 := a 4 = 0 All goals completed! 🐙

Conjecture: For $k \ge 1$, let $m_k = 10^k / 2 - 1$. Then for $i = 0, \ldots, m_k$, we have $a(m_k - i) = a(m_k + i)$.

A formal proof has been found with the methods described in arxiv/2605.22763.

@[category research solved, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/289411.wip.lean#L167"] theorem a_symm (k : ) (hk : 0 < k) : let m_k : := (10 ^ k) / 2 - 1 i : , i m_k a (m_k - i) = a (m_k + i) := k:hk:0 < klet m_k := 10 ^ k / 2 - 1; i m_k, OeisA289411.a (m_k - i) = OeisA289411.a (m_k + i) All goals completed! 🐙end OeisA289411