This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A329201 #25 Dec 23 2024 14:53:46 %S A329201 0,1,2,3,4,5,6,7,8,9,11,11,13,11,17,11,21,11,25,11,18,22,22,24,22,28, %T A329201 22,32,22,36,33,29,33,33,35,33,39,33,43,33,36,44,40,44,44,46,44,50,44, %U A329201 54,55,47,55,51,55,55,57,55,61,55,54,66,58,66,62,66,66,68,66,72,77,65,77,69,77,73,77 %N A329201 The ghost iteration (B): add or subtract the number formed by absolute differences of digits (A040115), according to parity (odd or even). %C A329201 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. %C A329201 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"). %C A329201 See the table A329342 for the list of these cycles. %H A329201 E. Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2019-November/">The ghost iteration</a>, SeqFan list, Nov 2019. %H A329201 E. Angelini, <a href="/A329200/a329200.txt">The ghost iteration</a>, SeqFan list, Nov 2019 [Cached copy, with permission] %H A329201 E. Angelini, <a href="http://cinquantesignes.blogspot.com/2019/11/the-ghost-iteration.html">The Ghost Iteration</a>, Personal blog "Cinquante signes", Nov 2019. %H A329201 E. Angelini, <a href="/A040115/a040115.pdf">The Ghost Iteration</a>, Personal blog "Cinquante signes", Nov 2019 [Cached copy, pdf file, with permission] %F A329201 a(n) = n - (-1)^d*d where d = A040115(n), 0 for n < 10. %e A329201 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. %o A329201 (PARI) apply( A329201(n)={n-(-1)^(n=fromdigits(abs((n=digits(n+!n))[^-1]-n[^1])))*n}, [1..199]) %Y A329201 Cf. A040115, A329200 (variant A: add/subtract if even/odd), A010785 (fixed points). %Y A329201 Cf. A329342 (list of cycles). %K A329201 nonn,base,easy %O A329201 0,3 %A A329201 _Eric Angelini_ and _M. F. Hasler_, Nov 09 2019