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 A007651 M4768 #31 Sep 18 2022 12:10:54 %S A007651 1,11,12,1121,122111,112213,12221131,1123123111,12213111213113, %T A007651 11221131132111311231,12221231123121133112213111, %U A007651 1123112131122131112112321222113113,1221311221113112221131132112213121112312311231 %N A007651 Describe the previous term! (method B - initial term is 1). %C A007651 Method B = 'digit'-indication followed by 'frequency'. %D A007651 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A007651 Reinhard Zumkeller, <a href="/A007651/b007651.txt">Table of n, a(n) for n = 1..25</a> %F A007651 a(n) = Sum_{k=1..A005341(n)} A220424(n,k)*10^(A005341(n)-k). - _Reinhard Zumkeller_, Dec 15 2012 %e A007651 The term after 1121 is obtained by saying "1 twice, 2 once, 1 once", which gives 122111. %t A007651 RunLengthEncode[ x_List ] := (Through[ {First, Length}[ #1 ] ] &) /@ Split[ x ]; LookAndSay[ n_, d_:1 ] := NestList[ Flatten[ Reverse /@ RunLengthEncode[ # ] ] &, {d}, n - 1 ]; F[ n_ ] := LookAndSay[ n, 1 ][ [ n ] ]; Table[ FromDigits[ Reverse[ F[ n ] ] ], {n, 1, 15} ] %t A007651 a[1] = 1; a[n_] := a[n] = FromDigits[Flatten[{First[#], Length[#]}&/@Split[IntegerDigits[a[n-1]]]]]; Map[a, Range[25]] (* _Peter J. C. Moses_, Mar 22 2013 *) %o A007651 (Haskell) %o A007651 a007651 = foldl1 (\v d -> 10 * v + d) . map toInteger . a220424_row %o A007651 -- _Reinhard Zumkeller_, Dec 15 2012 %o A007651 (Python) %o A007651 from itertools import accumulate, groupby, repeat %o A007651 def summarize(n, _): return int("".join(k+str(len(list(g))) for k, g in groupby(str(n)))) %o A007651 def aupto(terms): return list(accumulate(repeat(1, terms), summarize)) %o A007651 print(aupto(13)) # _Michael S. Branicky_, Sep 18 2022 %Y A007651 Cf. A005150, A022470, A022499, A022500-A022505. %K A007651 nonn,base,easy,nice %O A007651 1,2 %A A007651 _N. J. A. Sloane_