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.

Showing 1-3 of 3 results.

A007651 Describe the previous term! (method B - initial term is 1).

Original entry on oeis.org

1, 11, 12, 1121, 122111, 112213, 12221131, 1123123111, 12213111213113, 11221131132111311231, 12221231123121133112213111, 1123112131122131112112321222113113, 1221311221113112221131132112213121112312311231
Offset: 1

Views

Author

Keywords

Comments

Method B = 'digit'-indication followed by 'frequency'.

Examples

			The term after 1121 is obtained by saying "1 twice, 2 once, 1 once", which gives 122111.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007651 = foldl1 (\v d -> 10 * v + d) . map toInteger . a220424_row
    -- Reinhard Zumkeller, Dec 15 2012
    
  • Mathematica
    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} ]
    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 *)
  • Python
    from itertools import accumulate, groupby, repeat
    def summarize(n, _): return int("".join(k+str(len(list(g))) for k, g in groupby(str(n))))
    def aupto(terms): return list(accumulate(repeat(1, terms), summarize))
    print(aupto(13)) # Michael S. Branicky, Sep 18 2022

Formula

a(n) = Sum_{k=1..A005341(n)} A220424(n,k)*10^(A005341(n)-k). - Reinhard Zumkeller, Dec 15 2012

A005341 Length of n-th term in Look and Say sequences A005150 and A007651.

Original entry on oeis.org

1, 2, 2, 4, 6, 6, 8, 10, 14, 20, 26, 34, 46, 62, 78, 102, 134, 176, 226, 302, 408, 528, 678, 904, 1182, 1540, 2012, 2606, 3410, 4462, 5808, 7586, 9898, 12884, 16774, 21890, 28528, 37158, 48410, 63138, 82350, 107312, 139984, 182376, 237746, 310036, 403966, 526646, 686646
Offset: 1

Views

Author

Keywords

Comments

Row lengths of A034002 and of A220424. - Reinhard Zumkeller, Dec 15 2012
Satisfies a recurrence of order 72. The characteristic polynomial of this recurrence is a degree-72 polynomial that factors as (x-1)*q(x), where q(x) is a degree-71 polynomial. The unique positive real root of q is approximately 1.3036 and is called Conway's constant (A014715), which equals the limiting ratio a(n+1)/a(n). - Nathaniel Johnston, Apr 12 2018 [Corrected by Richard Stanley, Dec 26 2018]

References

  • J. H. Conway, The weird and wonderful chemistry of audioactive decay, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Communications, Springer, NY 1987, pp. 173-188.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Haskell
    a005341 = length . a034002_row  -- Reinhard Zumkeller, Dec 15 2012
  • Mathematica
    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[ Length[ F[ n ] ], {n, 1, 51} ]
    p = {12, -18, 18, -18, 18, -20, -22, 31, 15, -4, -4, -19, 62, -50, -21, -11, 41, 54, -56, -44, 15, -27, -15, 45, -8, 89, -64, -66, -25, 38, 126, -39, -32, -33, -65, 107, 14, 16, -13, -79, 7, 42, 12, 8, -26, -9, 35, -23, -20, -30, 34, 58, -1, -20, -36, -6, 13, 8, 6, 3, -1, -4, -1, -4, -5, -1, 8, 6, 0, -6, -4, 1, 0, 1, 1, 1, 1, -1, -1}; q = {-6, 9, -9, 18, -16, 11, -14, 8, -1, 5, -7, -2, -8, 14, 5, 5, -19, -3, 6, 7, 6, -16, 7, -8, 22, -17, 12, -7, -5, -7, 8, -4, 7, 9, -13, 4, 6, -14, 14, -19, 7, 13, -2, 4, -18, 0, 1, 4, 12, -8, 5, 0, -8, -1, -7, 8, 5, 2, -3, -3, 0, 0, 0, 0, 2, 1, 0, -3, -1, 1, 1, 1, -1}; gf = Fold[x #1 + #2 &, 0, p]/Fold[x #1 + #2 &, 0, q]; CoefficientList[Series[gf, {x, 0, 99}], x] (* Peter J. C. Moses, Jun 23 2013 *)
  • PARI
    print1(a=1);for(i=2,100,print1(",",#Str(a=A005150(2,a))))  \\ M. F. Hasler, Nov 08 2011
    

Formula

a(n) = A055642(A005150(n)) = A055642(A007651(n)). - Reinhard Zumkeller, Dec 15 2012

Extensions

More terms from Mike Keith

A034002 A005150 expanded into single digits.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Keywords

Examples

			Initial rows                             A005150
  1:  1                                           1
  2:  1,1                                        11
  3:  2,1                                        21
  4:  1,2,1,1                                  1211
  5:  1,1,1,2,2,1                            111221
  6:  3,1,2,2,1,1                            312211
  7:  1,3,1,1,2,2,2,1                      13112221
  8:  1,1,1,3,2,1,3,2,1,1                1113213211
  9:  3,1,1,3,1,2,1,1,1,3,1,2,2,1    31131211131221
		

Crossrefs

See the entry for A005150 for much more about this sequence.
Cf. A088203.
Cf. A005341 (row lengths), A220424 (method B version).

Programs

  • Haskell
    -- see Watkins link, p. 3.
    import Data.List (group)
    a034002 n k = a034002_tabf !! (n-1) !! (k-1)
    a034002_row n = a034002_tabf !! (n-1)
    a034002_tabf = iterate
                   (concat . map (\xs -> [length xs, head xs]) . group) [1]
    -- Reinhard Zumkeller, Aug 09 2012
    
  • Python
    from sympy import flatten
    l=[1]
    L=[1]
    n=s=1
    y=''
    while n<21:
        x=str(l[n - 1]) + ' '
        for i in range(len(x) - 1):
            if x[i]==x[i + 1]: s+=1
            else:
                y+=str(s)+str(x[i])
                s=1
        x=''
        n+=1
        l.append(int(y))
        L.append([int(a) for a in list(y)])
        y=''
        s=1
    print(l) # A005150
    print(flatten(L)) # Indranil Ghosh, Jul 05 2017

Formula

A005150(n) = Sum_{k=1..A005341(n)} T(n,k)*10^(A005341(n) - k). - Reinhard Zumkeller, Dec 15 2012

Extensions

Offset changed and keyword tabf added by Reinhard Zumkeller, Aug 09 2012
Showing 1-3 of 3 results.