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 A359142 #77 Dec 21 2024 17:35:46 %S A359142 0,0,0,0,0,0,0,0,0,0,112,123,134,145,156,167,178,189,90,0,213,224,235, %T A359142 246,257,268,279,2810,2911,0,314,325,336,347,358,369,3710,3811,3912,0, %U A359142 415,426,437,448,459,4610,4711,4812,4913,0,516,527,538,549,5510,5611,5712,5813 %N A359142 Let s = sum of digits of n, let t = decimal concatenation of n and s, let u be obtained by deleting all copies of the leading digit of t from t, if this digit occurs in s. Then if u has only zero digits, a(n) = 0; if u has leading digit 0 but not all its digits are 0, delete all leading 0's from u and negate the result to get a(n); otherwise a(n) = u. %C A359142 Since nonzero numbers may not have leading zeros, we indicate their presence by negating the number. %C A359142 For use in A359142, we also define a(n) for improper decimal numbers n with leading zeros by following exactly the same steps. To get a(073), for example, we append the digit sum 10, and delete the 0's from 07310, getting a(073) = 731. To get a(074), we append 11, getting 07411, so a(074) = -7411. %C A359142 The sequence of n such that a(n) < 0 begins (109, 1009, 1018, 1019, 1027, 1028, 1029, 1036, ...): see A359144. - _M. F. Hasler_, Feb 01 2023 %H A359142 Michael S. Branicky, <a href="/A359142/b359142.txt">Table of n, a(n) for n = 1..10000</a> %H A359142 Eric Angelini, <a href="https://cinquantesignes.blogspot.com/2022/07/does-this-iteration-end-sum-and-erase.html?m=1">Does this iteration end? (Sum and erase)</a>, Personal blog "Cinquante Signes", blogspot.com, Jul 26 2022. %H A359142 Eric Angelini, <a href="/A359142/a359142.pdf">Does this iteration end? (Sum and erase)</a>, Personal blog "Cinquante Signes", blogspot.com, Jul 26 2022. [Cached copy, pdf file, with permission] %H A359142 Hans Havermann, <a href="https://gladhoboexpress.blogspot.com/2022/07/cycles-in-eric-angelinis-sum-and-erase.html">Cycles in Eric Angelini's sum-and-erase</a>, Personal blog "Glad Hobo Express", blogspot.com, Jul 28 2022. %H A359142 N. J. A. Sloane, New Gilbreath Conjectures, Sum and Erase, Dissecting Polygons, and Other New Sequences, Doron Zeilberger's Exper. Math. Seminar, Rutgers, Sep 14 2023: <a href="https://vimeo.com/866583736?share=copy">Video</a>, <a href="http://neilsloane.com/doc/EMSep2023.pdf">Slides</a>, <a href="http://neilsloane.com/doc/EMSep2023.Updates.txt">Updates</a>. (Mentions this sequence.) %e A359142 Examples: %e A359142 n.....s......t....u.....a(n) %e A359142 1.....1.....11....0......0 %e A359142 2.....2.....22....0......0 %e A359142 ..... %e A359142 9.....9.....99....0......0 %e A359142 10....1....101....0......0 %e A359142 11....2....112..112....112 %e A359142 12....3....123..123....123 %e A359142 ..... %e A359142 100...1...1001...00......0 %e A359142 101...2...1012.1012...1012 %e A359142 102...3...1023.1023...1023 %e A359142 ..... %e A359142 109..10..10910..090....-90 %e A359142 ..... %t A359142 A359142[n_]:= Module[{d=IntegerDigits[n],s,u},If[MemberQ[s=IntegerDigits[Total[d]],First[u=Join[d,s]]],u=DeleteCases[u,First[u]]];If[u=={}||First[u]==0,-1,1]FromDigits[u]];Array[A359142,100] (* _Paolo Xausa_, Oct 11 2023 *) %o A359142 (PARI) A359142(n) = { my(d=digits(n), s=digits(vecsum(d))); n>0 || d=concat(0,d); n=concat(d, s); setsearch(Set(s), d[1]) && n=select(c->c!=d[1], n); if(n && !n[1], -fromdigits(n), fromdigits(n)) } %o A359142 apply(A359142, [0..99]) \\ _M. F. Hasler_, Feb 01 2023 %o A359142 (Python) %o A359142 def a(n): %o A359142 n = str(-n) if isinstance(n, int) and n < 0 else str(n) %o A359142 s = str(sum(map(int, n))) %o A359142 t = n + s %o A359142 u = t.replace(t[0], "") if t[0] in s else t %o A359142 return 0 if u == "" else (-int(u) if u[0] == "0" else int(u)) %o A359142 print([a(n) for n in range(1, 59)]) # _Michael S. Branicky_, Feb 01 2023 %Y A359142 Cf. A359143, A359144 (k such that a(k)<0). %K A359142 sign,base %O A359142 1,11 %A A359142 _N. J. A. Sloane_, Jan 31 2023, based on suggestions from _Eric Angelini_ and _Hans Havermann_ %E A359142 More terms from _M. F. Hasler_, Feb 01 2023