cp's OEIS Frontend

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.

A034002 A005150 expanded into single digits.

This page as a plain text file.
%I A034002 #41 Apr 19 2025 18:07:53
%S A034002 1,1,1,2,1,1,2,1,1,1,1,1,2,2,1,3,1,2,2,1,1,1,3,1,1,2,2,2,1,1,1,1,3,2,
%T A034002 1,3,2,1,1,3,1,1,3,1,2,1,1,1,3,1,2,2,1,1,3,2,1,1,3,1,1,1,2,3,1,1,3,1,
%U A034002 1,2,2,1,1,1,1,1,3,1,2,2,1,1,3,3,1,1,2,1,3,2,1,1,3,2,1,2,2,2,1
%N A034002 A005150 expanded into single digits.
%H A034002 Reinhard Zumkeller, <a href="/A034002/b034002.txt">Rows n = 1..25 of triangle, flattened</a>
%H A034002 J. H. Conway, <a href="http://www.math.utah.edu/~boocher/writings/ConwayLook.pdf">The weird and wonderful chemistry of audioactive decay</a>, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Computation, Springer, NY 1987, pp. 173-188. DOI: 10.1007/978-1-4612-4808-8_53.
%H A034002 M. Lothaire, <a href="http://www-igm.univ-mlv.fr/~berstel/Lothaire/">Algebraic Combinatorics on Words</a>, Cambridge, 2002, see p. 36.
%H A034002 Kevin Watkins, <a href="http://www.cs.cmu.edu/~kw/pubs/conway.pdf">Abstract Interpretation Using Laziness: Proving Conway's Lost Cosmological Theorem</a>
%H A034002 Kevin Watkins, <a href="http://www.cs.cmu.edu/~kw/pubs/conwayslides.pdf">Proving Conway's Lost Cosmological Theorem</a>, POP seminar talk, CMU, Dec 2006.
%H A034002 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/LookandSaySequence.html">Look and Say Sequence</a>
%H A034002 Wikipedia, <a href="http://en.wikipedia.org/wiki/Look-and-say_sequence">Look-and-say sequence</a>
%F A034002 A005150(n) = Sum_{k=1..A005341(n)} T(n,k)*10^(A005341(n) - k). - _Reinhard Zumkeller_, Dec 15 2012
%e A034002 Initial rows                             A005150
%e A034002   1:  1                                           1
%e A034002   2:  1,1                                        11
%e A034002   3:  2,1                                        21
%e A034002   4:  1,2,1,1                                  1211
%e A034002   5:  1,1,1,2,2,1                            111221
%e A034002   6:  3,1,2,2,1,1                            312211
%e A034002   7:  1,3,1,1,2,2,2,1                      13112221
%e A034002   8:  1,1,1,3,2,1,3,2,1,1                1113213211
%e A034002   9:  3,1,1,3,1,2,1,1,1,3,1,2,2,1    31131211131221
%o A034002 (Haskell) -- see Watkins link, p. 3.
%o A034002 import Data.List (group)
%o A034002 a034002 n k = a034002_tabf !! (n-1) !! (k-1)
%o A034002 a034002_row n = a034002_tabf !! (n-1)
%o A034002 a034002_tabf = iterate
%o A034002                (concat . map (\xs -> [length xs, head xs]) . group) [1]
%o A034002 -- _Reinhard Zumkeller_, Aug 09 2012
%o A034002 (Python)
%o A034002 from sympy import flatten
%o A034002 l=[1]
%o A034002 L=[1]
%o A034002 n=s=1
%o A034002 y=''
%o A034002 while n<21:
%o A034002     x=str(l[n - 1]) + ' '
%o A034002     for i in range(len(x) - 1):
%o A034002         if x[i]==x[i + 1]: s+=1
%o A034002         else:
%o A034002             y+=str(s)+str(x[i])
%o A034002             s=1
%o A034002     x=''
%o A034002     n+=1
%o A034002     l.append(int(y))
%o A034002     L.append([int(a) for a in list(y)])
%o A034002     y=''
%o A034002     s=1
%o A034002 print(l) # A005150
%o A034002 print(flatten(L)) # _Indranil Ghosh_, Jul 05 2017
%Y A034002 See the entry for A005150 for much more about this sequence.
%Y A034002 Cf. A088203.
%Y A034002 Cf. A005341 (row lengths), A220424 (method B version).
%K A034002 nonn,base,tabf
%O A034002 1,4
%A A034002 _N. J. A. Sloane_
%E A034002 Offset changed and keyword tabf added by _Reinhard Zumkeller_, Aug 09 2012