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-6 of 6 results.

A006751 Describe the previous term! (method A - initial term is 2).

Original entry on oeis.org

2, 12, 1112, 3112, 132112, 1113122112, 311311222112, 13211321322112, 1113122113121113222112, 31131122211311123113322112, 132113213221133112132123222112, 11131221131211132221232112111312111213322112, 31131122211311123113321112131221123113111231121123222112
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
No digit exceeds 3. If the starting number a(1) is a single-digit number greater than 3 this will remain as the last digit, all the remaining in any term being no greater than 3. - Carmine Suriano, Sep 07 2010
a(n) = value of concatenation of n-th row in A088203. - Reinhard Zumkeller, Aug 09 2012
This is because for all n > 1, a(n) begins with 1 or 3 and ends with 2. - Jean-Christophe Hervé, May 07 2013
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			E.g. the term after 3112 is obtained by saying "one 3, two 1's, one 2", which gives 132112.
		

References

  • 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).
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • Haskell
    a006751 = foldl1 (\v d -> 10 * v + d) . map toInteger . a088203_row
    -- Reinhard Zumkeller, Aug 09 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, 2 ][ [ n ] ]; Table[ FromDigits[ F[ n ] ], {n, 11} ] (* Zerinvary Lajos, Mar 21 2007 *)
  • Perl
    # This outputs the first n elements of the sequence, where n is given on the command line.
    $s = 2;
    for (2..shift @ARGV) {
        print "$s, ";
        $s =~ s/(.)\1*/(length $&).$1/eg;
    }
    print "$s\n";
    ## Arne 'Timwi' Heizmann (timwi(AT)gmx.net), Mar 12 2008
    
  • Python
    l=[2]
    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))
        y=''
        s=1
    print(l) # Indranil Ghosh, Jul 05 2017

Formula

a(n+1) = A045918(a(n)). - Reinhard Zumkeller, Aug 09 2012

A225224 A continuous "look-and-say" sequence (without repetition, seed 1,1,1).

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 3, 2, 1, 1, 3, 1, 2, 2, 1, 1, 3, 1, 1, 2, 2, 2, 1, 1, 3, 2, 1, 3, 2, 2, 1, 1, 3, 1, 2, 1, 1, 1, 3, 2, 2, 2, 1, 1, 3, 1, 1, 1, 2, 3, 1, 1, 3, 3, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 3, 2, 1, 2, 3, 2, 2, 2, 1, 2, 3, 2, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1
Offset: 1

Views

Author

Jean-Christophe Hervé, May 02 2013

Keywords

Comments

A variant of the Conway's 'look-and-say' sequence A005150, without run cut-off. It describes at each step the preceding numbers taken altogether.
The sequence is better described as starting with three 1's: 1, 1, 1, and then 3, 1, and 1, 3, etc., as seed one creates a singular case: 1, then 1, 1, which can be continued either as 2, 1 (ignoring the aforesaid first 1, cf. A221646), or as 3, 1, considering twice the first one.
Contrary to the original look-and-say, this sequence is not base dependent, because figures or group of figures are not aggregated and read as numbers.
The sequence is determined by pairs. Terms of even ranks are counts while odd ranks are numbers.
As in the original look-and-say sequence, a(n) is always equal to 1, 2 or 3. The subsequence 3,3,3 never appears.
Two successive odd ranks cannot be equal, which implies that sequences of length three always begin on even rank and that two such sequences never follow each other.
Applying the look-and-say principle to the sequence itself, it is simply shift three ranks to the left.
With seed 2 (resp. 3), the sequence is A088203 (resp. A088204). These two sequences are shifted one rank left by the look-and-say transform.
With seed 2, the sequence A088203 is the concatenation of A006751 (original look-and-say method by blocks): this is because all blocks begin with 1 or 3 and end with 2 and therefore, there is no possible interaction between blocks after concatenation.

Examples

			The sequence starts with: 1, 1, 1
The first group has three 1's: 3, 1
The next group has one 3: 1, 3
The next group has two 1's: 2, 1
The next group has one 3: 1, 3
The next group has one 2: 1, 2
The next group has two 1's: 2, 1, etc.
		

Crossrefs

Cf. A005150 (original look-and-say sequence).
Cf. A221646 (a close variant with seed 1).
Cf. A225212 (a variant with nested repetitions).
Cf. A088203 (seed 2), A088204 (seed 3).
Cf. A225330 (look-and-repeat).

Programs

  • C
    /* computes first n terms in array a[] */
    int *swys(int n) {
    int a[n] ;
    int see, say, c ;
    a[0] = 1;
    see = say = 0 ;
    while( say < n-1 ) {
      c = 0 ;     /* count */
      dg = a[see] /* digit */
      if (say > 0) { /* not the first time */
        while (see <= say) {
          if (a[see]== dg)  c += 1 ;
          else break ;
          see += 1 ;
          }
        }
      else {
       c = 1 ;
        }
      a[++say] = c ;
      if (say < n-1) a[++say] = dg ;
      }
    return(a);
    }
  • Mathematica
    n = 100; a[0] = 1; see = say = 0; While[ say < n - 1, c = 0; dg = a[see]; If[say > 0, While[ see <= say, If[a[see] == dg, c += 1, Break[]]; see += 1], c = 1]; a[++say] = c; If[say < n - 1, a[++say] = dg]]; Array[a, n, 0] (* Jean-François Alcover, Jul 11 2013, translated and adapted from J.-C. Hervé's C program *)

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

A088204 Infinite audioactive word that shifts 1 place left under "Look and Say" method A, starting with a(1)=3.

Original entry on oeis.org

3, 1, 3, 1, 1, 1, 3, 3, 1, 2, 3, 1, 1, 1, 2, 1, 3, 3, 1, 1, 2, 1, 1, 2, 3, 2, 1, 1, 2, 2, 1, 1, 2, 1, 3, 1, 2, 2, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 3, 2, 2, 1, 1, 2, 3, 1, 1, 3, 2, 1, 2, 2, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2, 1, 3, 2, 1, 1, 3, 1, 2, 1, 1, 3, 2, 2, 1, 1, 3, 3, 2, 2, 1, 1, 2, 1, 1, 1, 3
Offset: 1

Views

Author

Paul D. Hanna, Sep 22 2003

Keywords

Comments

The sequence is obtained continuously by applying the look-and-say rule from seed 3 : 3 -> 1,3 -> 1,1,1,3 -> etc. The sequence is then determined by pairs of digits. Terms of even ranks are counts while odd ranks are figures. A225224 and A221646 are from seed 1 and A088203 from seed 2. [Jean-Christophe Hervé, May 07 2013]

Crossrefs

Cf. A225224, A221646 (seed one).

A088205 Infinite audioactive word that shifts 1 place left under "Look and Say" method A, starting with a(0)=0.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 0, 3, 1, 1, 0, 1, 3, 2, 1, 1, 0, 1, 1, 1, 3, 1, 2, 2, 1, 1, 0, 3, 1, 1, 3, 1, 1, 2, 2, 2, 1, 1, 0, 1, 3, 2, 1, 1, 3, 2, 1, 3, 2, 2, 1, 1, 0, 1, 1, 1, 3, 1, 2, 2, 1, 1, 3, 1, 2, 1, 1, 1, 3, 2, 2, 2, 1, 1, 0, 3, 1, 1, 3, 1, 1, 2, 2, 2, 1, 1, 3, 1, 1, 1, 2, 3, 1, 1, 3, 3, 2, 2, 1, 1, 0, 1, 3, 2, 1
Offset: 0

Views

Author

Paul D. Hanna, Sep 22 2003

Keywords

Comments

Positions of zero are given by A088206.
The sequence is obtained by starting with 0 and then successively appending the count (number of repetitions) and the value which is seen, term after term: "one zero, one one, one zero, three ones, one zero, ...". Otherwise said, the sequence is defined by "Start with 0 and append the result of "Look and Say" applied to the sequence". The "shifted left under Look and Say" property is thus an immediate consequence of the definition. A less trivial property is that there cannot be a number larger than 3 in this sequence. - M. F. Hasler, Jul 28 2015

Examples

			The initial terms {0,1,0,1,1,1,0,3,1,1,0,...} are shifted 1 place left by saying: "one 0, one 1, one 0, three 1's, one 0, ...", which drops the leading 0 to give {1,0,1,1,1,0,3,1,1,0,...}.
		

Crossrefs

Programs

  • PARI
    a=List(0);my(i=1);while(#a<200,listput(a,1);listput(a,a[i]);while(a[i++]==a[#a],a[#a-1]++));a \\ M. F. Hasler, Jul 28 2015

A088206 Positions of zero in the infinite audioactive word, A088205, which shifts left under "Look and Say" method A, starting with a(1)=0.

Original entry on oeis.org

1, 3, 7, 11, 17, 27, 39, 53, 75, 101, 131, 175, 231, 301, 399, 529, 691, 907, 1199, 1557, 2027, 2655, 3447, 4497, 5881, 7669, 10003, 13075, 17049, 22211, 28995, 37781, 49201, 64193
Offset: 1

Views

Author

Paul D. Hanna, Sep 22 2003

Keywords

Comments

Empirically the partial sums of A022471. - Sean A. Irvine, Jul 13 2022

Examples

			The initial terms of A088205, {0,1,0,1,1,1,0,3,1,1,0,...}, are shift left by saying: "one 0, one 1, one 0, three 1's, one 0, ...", which drops the leading 0 to give {1,0,1,1,1,0,3,1,1,0,...}.
		

Crossrefs

Showing 1-6 of 6 results.