/-
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.
-/importFormalConjecturesUtil
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.
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.
noncomputabledefa(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).letP(k:ℕ):Prop:=n∣Nat.iteratef(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,Pk)(funh_exists=>letk₀:ℕ:=Nat.findh_existsNat.iteratef(k₀+1)n)(fun_=>0)
If n already divides f n, the search stops immediately and a n = f n.