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 A329200 #33 Dec 23 2024 14:53:46 %S A329200 0,1,2,3,4,5,6,7,8,9,9,11,11,15,11,19,11,23,11,27,22,20,22,22,26,22, %T A329200 30,22,34,22,27,33,31,33,33,37,33,41,33,45,44,38,44,42,44,44,48,44,52, %U A329200 44,45,55,49,55,53,55,55,59,55,63,66,56,66,60,66,64,66,66,70,66,63,77,67,77,71,77 %N A329200 The ghost iteration (A): add or subtract the number formed by absolute differences of digits (A040115), according to parity (even or odd). %C A329200 Sequence A040115 is most naturally extended to 0 (empty sum) for single-digit arguments; that's what we use here. This value is added to n if even, subtracted if odd. %C A329200 Repdigit numbers are the fixed points. Other starting values end in nontrivial loops under iterations of this map, like 11090 -> 10891 -> 12709 -> 11130 -> 11107 -> 11090 etc. Table A329196 lists these cycles, A329197 their lengths. %C A329200 A329198 gives the size of n's orbit, i.e., the length of the trajectory until the terminating cycle is covered. %H A329200 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 A329200 E. Angelini, <a href="/A329200/a329200.txt">The ghost iteration</a>, SeqFan list, Nov 2019 [Cached copy, with permission] %H A329200 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 A329200 E. Angelini, <a href="/A040115/a040115.pdf">The Ghost Iteration</a>, Personal blog "Cinquante signes", Nov 2019 [Cached copy, pdf file, with permission] %F A329200 a(n) = n + (-1)^d*d where d = A040115(n), 0 for n < 10. %e A329200 For n = 101, the number formed by the absolute differences of digits is 11, since this is odd it is subtracted from n, so a(101) = 101-11 = 90. %o A329200 (PARI) apply( A329200(n)={n+(-1)^(n=fromdigits(abs((n=digits(n+!n))[^-1]-n[^1])))*n}, [1..199]) %Y A329200 Cf. A040115, A329201 (variant B: add/subtract if odd/even). %Y A329200 Cf. A329196 (cycles), A329197 (lengths), A329198 (size of orbit of n). %K A329200 nonn,base,easy %O A329200 0,3 %A A329200 _Eric Angelini_ and _M. F. Hasler_, Nov 09 2019