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 A126616 #25 Aug 02 2022 09:18:45 %S A126616 1,2,3,4,5,6,7,8,9,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,3,2,1,3,2, %T A126616 1,3,2,1,3,4,2,1,3,4,2,1,3,4,2,5,1,3,4,2,5,1,3,4,2,6,5,1,3,4,2,6,5,1, %U A126616 3,7,4,2,6,5,1,3,7,4,2,8,6,5,1,3,7,4,2,8,6,9,5,1,3,7,4,2,8,6,9,1,5,1,3,7,4 %N A126616 a(n) = n for n < 10, a(10*n) = a(n), and if the terms a(10), a(20), a(30), ... are deleted, one gets back the original sequence. %C A126616 A self-generating sequence. %C A126616 Invented by Eric Angelini. Might also be called a lizard sequence (une suite du lézard) because it grows back from its tail. %D A126616 J.-P. Delahaye, La suite du lézard et autres inventions, Pour la Science, No. 353, 2007. %p A126616 A126616 := proc(n) option remember ; if n < 10 then n ; elif n mod 10 = 0 then A126616(n/10) ; else A126616( n-floor(n/10) ) ; fi ; end: seq(A126616(n),n=1..120) ; # _R. J. Mathar_, Oct 02 2007 %t A126616 a[n_] := Module[{m = 10, k = n, q}, While[k >= m, q = Quotient[k, m]; If[Mod[k, m] != 0, k -= q, k = q]]; k]; %t A126616 Table[a[n], {n, 1, 105}] (* _Jean-François Alcover_, Aug 02 2022, after _M. F. Hasler_ *) %o A126616 (PARI) a(n,m=10)=while(n>=m,if(n%m,n-=n\m,n\=m));n \\ _M. F. Hasler_, Mar 07 2015 %Y A126616 Cf. A117943, A178931, A255824 - A255829. %K A126616 nonn,easy %O A126616 1,2 %A A126616 _N. J. A. Sloane_, Feb 09 2007 %E A126616 More terms from _R. J. Mathar_, Oct 02 2007 %E A126616 Definition rephrased by _M. F. Hasler_, Mar 09 2015