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

Conjectures associated with A100800

Let $f(n) = n + \text{sum of the digits of } n$. If $f(n)$ is multiple of $n$ then $a(n)= f(n)$ else $a(n) = f(f(f(n)))\dots$ until one gets a multiple of $n$; $a(n) = 0$ if no such number exists.

References:

namespace OeisA100800open Nat Function

The sum of the decimal digits of a natural number.

def sumDigits (n : ) : := ((10).digits n).sum

The function $f(n) = n + \text{sum of the digits of } n$.

def f (n : ) : := n + sumDigits nopen Classical in

a n is the first iteration of $f(n) = n + \text{sum of the digits of } n$ that is a multiple of $n$. $a(n) = 0$ if no such number exists.

noncomputable def a (n : ) : := -- P(k) holds if the (k+1)-th iteration of f is a multiple of n. -- k=0 corresponds to the first iteration, f(n). let P (k : ) : Prop := n Nat.iterate f (k + 1) n -- We use the noncomputable definition of finding the minimum index if it exists, -- or returning 0 otherwise, using the standard classical definition pattern. dite ( k, P k) (fun h_exists => let k₀ : := Nat.find h_exists Nat.iterate f (k₀ + 1) n) (fun _ => 0)

If n already divides f n, the search stops immediately and a n = f n.

n:h:n f nhex: k, n f^[k + 1] nhfind:Nat.find hex = 0(have k₀ := 0; f^[k₀ + 1] n) = f n All goals completed! 🐙

Term theorems verifying the first few values of the sequence against the official OEIS b-file

f 1 = 2; All goals completed! 🐙f 2 = 4; All goals completed! 🐙f 3 = 6; All goals completed! 🐙f 4 = 8; All goals completed! 🐙f 5 = 10; All goals completed! 🐙

A100800 Conjecture: No term is zero.

@[category research open, AMS 11] theorem conjecture : (n : ), n 0 a n 0 := (n : ), n 0 OeisA100800.a n 0 All goals completed! 🐙end OeisA100800