OFFSET
0,3
COMMENTS
Sequence A040115 is most naturally extended to 0 (empty sum) for single-digit arguments; that's what we use for n < 10 here. This value is subtracted from n if even, added if odd.
A040115 is zero iff the argument is a repdigit (A010785), which therefore are the fixed points of this map A329201. All small starting values reach a fixed point, but larger values may enter a nontrivial cycle (or "loop").
See the table A329342 for the list of these cycles.
LINKS
E. Angelini, The ghost iteration, SeqFan list, Nov 2019.
E. Angelini, The ghost iteration, SeqFan list, Nov 2019 [Cached copy, with permission]
E. Angelini, The Ghost Iteration, Personal blog "Cinquante signes", Nov 2019.
E. Angelini, The Ghost Iteration, Personal blog "Cinquante signes", Nov 2019 [Cached copy, pdf file, with permission]
FORMULA
a(n) = n - (-1)^d*d where d = A040115(n), 0 for n < 10.
EXAMPLE
For n = 101, the number formed by the absolute differences of digits is 11. Since this is odd it is added to n, so a(101) = 101 + 11 = 112.
PROG
(PARI) apply( A329201(n)={n-(-1)^(n=fromdigits(abs((n=digits(n+!n))[^-1]-n[^1])))*n}, [1..199])
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Eric Angelini and M. F. Hasler, Nov 09 2019
STATUS
approved