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-10 of 28 results. Next

A265849 First differences of A006751.

Original entry on oeis.org

10, 1100, 2000, 129000, 1112990000, 310198100000, 12900010100000, 1113122099909791900000, 31130009089198002000100000, 132082082098921801009009900000, 11131221131211000108018890978199979090100000, 31131122211299991892189900998999891000999919009909900000
Offset: 1

Views

Author

Altug Alkan, Dec 16 2015

Keywords

Comments

Also first differences of A006715, A001140, A001141, A001143, A001145, A001151, A001154. - Michel Marcus, Dec 16 2015
Note that A005150 has really different first differences characteristic because of its initial term that is 1.

Examples

			a(1) = A006751(2) - A006751(1) = 12 - 2 = 10.
a(2) = A006751(3) - A006751(2) = 1112 - 12 = 1100.
		

Crossrefs

Programs

  • Mathematica
    f[n_, d_: 1] := NestList[Flatten[Reverse /@ Map[Function[k, Through[{First, Length}@ k]], Split@ #]] &, {d}, n - 1]; Differences@ Array[FromDigits@ f[#, 2][[#]] &, {13}] (* Michael De Vlieger, Jan 03 2016, after Zerinvary Lajos at A006751 *)
  • PARI
    dpt(n) = {vd = []; d = digits(n); nbd = 0; old = -1; for (k=1, #d, if (d[k] == old, nbd ++, if (old != -1, vd = concat(vd, nbd); vd = concat(vd, old);); nbd = 1;); old = d[k];); vd = concat(vd, nbd); vd = concat(vd, old); subst(Pol(vd), x, 10);}
    lista(nn, x=2) = {v = vector(nn); v[1] = x; for (n=2, nn, nx = dpt(x); v[n] = nx; x = nx;); vector(nn-1, n, v[n+1] - v[n]);} \\ 2nd param x can any value between 2 and 9 \\ Michel Marcus, Dec 16 2015

Formula

a(n) = A006751(n+1) - A006751(n).
a(n) mod 10^5 = 0, for n > 5.
a(2*n+2) - a(2*n) mod 10^6 = 0, for n > 3.
a(2*n+1) - a(2*n-1) mod 10^7 = 0, for n > 3.

A005150 Look and Say sequence: describe the previous term! (method A - initial term is 1).

Original entry on oeis.org

1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, 31131211131221, 13211311123113112211, 11131221133112132113212221, 3113112221232112111312211312113211, 1321132132111213122112311311222113111221131221, 11131221131211131231121113112221121321132132211331222113112211, 311311222113111231131112132112311321322112111312211312111322212311322113212221
Offset: 1

Views

Author

Keywords

Comments

Method A = "frequency" followed by "digit"-indication.
Also known as the "Say What You See" sequence.
Only the digits 1, 2 and 3 appear in any term. - Robert G. Wilson v, Jan 22 2004
All terms end with 1 (the seed) and, except the third a(3), begin with 1 or 3. - Jean-Christophe Hervé, May 07 2013
Proof that 333 never appears in any a(n): suppose it appears for the first time in a(n); because of "three 3" in 333, it would imply that 333 is also in a(n-1), which is a contradiction. - Jean-Christophe Hervé, May 09 2013
This sequence is called "suite de Conway" in French (see Wikipédia link). - Bernard Schott, Jan 10 2021
Contrary to many accounts (including an earlier comment on this page), Conway did not invent the sequence. The first mention of the sequence appears to date back to the 1977 International Mathematical Olympiad in Belgrade, Yugoslavia. See the Editor's note on page 4, directly preceding Conway's article in Eureka referenced below. - Harlan J. Brothers, May 03 2024

Examples

			The term after 1211 is obtained by saying "one 1, one 2, two 1's", which gives 111221.
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 208.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, section 6.12 Conway's Constant, pp. 452-455.
  • M. Gilpin, On the generalized Gleichniszahlen-Reihe sequence, Manuscript, Jul 05 1994.
  • A. Lakhtakia and C. Pickover, Observations on the Gleichniszahlen-Reihe: An Unusual Number Theory Sequence, J. Recreational Math., 25 (No. 3, 1993), 192-198.
  • Clifford A. Pickover, Computers and the Imagination, St Martin's Press, NY, 1991.
  • Clifford A. Pickover, Fractal horizons: the future use of fractals, New York: St. Martin's Press, 1996. ISBN 0312125992. Chapter 7 has an extensive description of the elements and their properties.
  • C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 486.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, 1999, p. 23.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Cf. A001387, Periodic table: A119566.
Cf. A225224, A221646, A225212 (continuous versions).
Apart from the first term, all terms are in A001637.
About digits: A005341 (number of digits), A022466 (number of 1's), A022467 (number of 2's), A022468 (number of 3's), A004977 (sum of digits), A253677 (product of digits).
About primes: A079562 (number of distinct prime factors), A100108 (terms that are primes), A334132 (smallest prime factor).
Cf. A014715 (Conway's constant), A098097 (terms interpreted as written in base 4).

Programs

  • Haskell
    import List
    say :: Integer -> Integer
    say = read . concatMap saygroup . group . show
    where saygroup s = (show $ length s) ++ [head s]
    look_and_say :: [Integer]
    look_and_say = 1 : map say look_and_say
    -- Josh Triplett (josh(AT)freedesktop.org), Jan 03 2007
    
  • Haskell
    a005150 = foldl1 (\v d -> 10 * v + d) . map toInteger . a034002_row
    -- Reinhard Zumkeller, Aug 09 2012
    
  • Java
    See Paulo Ortolan link.
    
  • 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[ F[ n ] ], {n, 1, 15} ]
    A005150[1] := 1; A005150[n_] := A005150[n] = FromDigits[Flatten[{Length[#], First[#]}&/@Split[IntegerDigits[A005150[n-1]]]]]; Map[A005150, Range[25]] (* Peter J. C. Moses, Mar 21 2013 *)
  • PARI
    A005150(n,a=1)={ while(n--, my(c=1); for(j=2,#a=Vec(Str(a)), if( a[j-1]==a[j], a[j-1]=""; c++, a[j-1]=Str(c,a[j-1]); c=1)); a[#a]=Str(c,a[#a]); a=concat(a)); a }  \\ M. F. Hasler, Jun 30 2011
  • Perl
    $str="1"; for (1 .. shift(@ARGV)) { print($str, ","); @a = split(//,$str); $str=""; $nd=shift(@a); while (defined($nd)) { $d=$nd; $cnt=0; while (defined($nd) && ($nd eq $d)) { $cnt++; $nd = shift(@a); } $str .= $cnt.$d; } } print($str);
    # Jeff Quilici (jeff(AT)quilici.com), Aug 12 2003
    
  • Perl
    # This outputs the first n elements of the sequence, where n is given on the command line.
    $s = 1;
    for (2..shift @ARGV) {
    print "$s, ";
    $s =~ s/(.)\1*/(length $&).$1/eg;
    }
    # Arne 'Timwi' Heizmann (timwi(AT)gmx.net), Mar 12 2008
    print "$s\n";
    
  • Python
    def A005150(n):
        p = "1"
        seq = [1]
        while (n > 1):
            q = ''
            idx = 0 # Index
            l = len(p) # Length
            while idx < l:
                start = idx
                idx = idx + 1
                while idx < l and p[idx] == p[start]:
                    idx = idx + 1
                q = q + str(idx-start) + p[start]
            n, p = n - 1, q
            seq.append(int(p))
        return seq
    # Olivier Mengue (dolmen(AT)users.sourceforge.net), Jul 01 2005
    
  • Python
    def A005150(n):
        seq = [1] + [None] * (n - 1) # allocate entire array space
        def say(s):
            acc = '' # initialize accumulator
            while len(s) > 0:
                i = 0
                c = s[0] # char of first run
                while (i < len(s) and s[i] == c): # scan first digit run
                    i += 1
                acc += str(i) + c # append description of first run
                if i == len(s):
                    break # done
                else:
                    s = s[i:] # trim leading run of digits
            return acc
        for i in range(1, n):
            seq[i] = int(say(str(seq[i-1])))
        return seq
    # E. Johnson (ejohnso9(AT)earthlink.net), Mar 31 2008
    
  • Python
    # program without string operations
    def sign(n): return int(n > 0)
    def say(a):
        r = 0
        p = 0
        while a > 0:
            c = 3 - sign((a % 100) % 11) - sign((a % 1000) % 111)
            r += (10 * c + (a % 10)) * 10**(2*p)
            a //= 10**c
            p += 1
        return r
    a = 1
    for i in range(1, 26):
        print(i, a)
        a = say(a)
    # Volker Diels-Grabsch, Aug 18 2013
    
  • Python
    import re
    def lookandsay(limit, sequence = 1):
        if limit > 1:
            return lookandsay(limit-1, "".join([str(len(match.group()))+match.group()[0] for matchNum, match in enumerate(re.finditer(r"(\w)\1*", str(sequence)))]))
        else:
            return sequence
    # lookandsay(3) --> 21
    # Nicola Vanoni, Nov 29 2016
    
  • Python
    import itertools
    x = "1"
    for i in range(20):
        print(x)
        x = ''.join(str(len(list(g)))+k for k,g in itertools.groupby(x))
    # Matthew Cotton, Nov 12 2019
    

Formula

a(n+1) = A045918(a(n)). - Reinhard Zumkeller, Aug 09 2012
a(n) = Sum_{k=1..A005341(n)} A034002(n,k)*10^(A005341(n)-k). - Reinhard Zumkeller, Dec 15 2012
a(n) = A004086(A007651(n)). - Bernard Schott, Jan 08 2021
A055642(a(n+1)) = A005341(n+1) = 2*A043562(a(n)). - Ya-Ping Lu, Jan 28 2025
Conjecture: DC(a(n)) ~ k * (Conway's constant)^n where k is approximately 1.021... and DC denotes the number of digit changes in the decimal representation of n (e.g., DC(13112221)=4 because 1->3, 3-1, 1->2, 2->1). - Bill McEachen, May 09 2025
Conjecture: lim_{n->infinity} (c2+c3-c1)/(c1+c2+c3) = 0.01 approximately, where ci is the number of appearances of 'i' in a(n). - Ya-Ping Lu, Jun 05 2025

A006715 Describe the previous term! (method A - initial term is 3).

Original entry on oeis.org

3, 13, 1113, 3113, 132113, 1113122113, 311311222113, 13211321322113, 1113122113121113222113, 31131122211311123113322113, 132113213221133112132123222113, 11131221131211132221232112111312111213322113, 31131122211311123113321112131221123113111231121123222113
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			The term after 3113 is obtained by saying "one 3, two 1's, one 3", which gives 132113.
		

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

Cf. A088204 (continuous version).

Programs

  • 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, 3 ][ [ 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 = 3;
    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

A001155 Describe the previous term! (method A - initial term is 0).

Original entry on oeis.org

0, 10, 1110, 3110, 132110, 1113122110, 311311222110, 13211321322110, 1113122113121113222110, 31131122211311123113322110, 132113213221133112132123222110, 11131221131211132221232112111312111213322110, 31131122211311123113321112131221123113111231121123222110
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
a(n), A001140, A001141, A001143, A001145, A001151 and A001154 are all identical apart from the last digit of each term (the seed). This is because digits other than 1, 2 and 3 never arise elsewhere in the terms (other than at the end of each of them) of look-and-say sequences of this type (as is mentioned by Carmine Suriano in A006751). - Chayim Lowen, Jul 16 2015
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			The term after 3110 is obtained by saying "one 3, two 1's, one 0", which gives 132110.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • Mathematica
    A001155[1] := 0; A001155[n_] := A001155[n] = FromDigits[Flatten[{Length[#], First[#]}&/@Split[IntegerDigits[A001155[n-1]]]]]; Map[A001155,Range[15]] (* Peter J. C. Moses, Mar 21 2013 *)
  • PARI
    A001155(n,a=0)={ while(n--, my(c=1); for(j=2,#a=Vec(Str(a)), if( a[j-1]==a[j], a[j-1]=""; c++, a[j-1]=Str(c,a[j-1]); c=1)); a[#a]=Str(c,a[#a]); a=concat(a)); a }  \\ M. F. Hasler, Jun 30 2011
    
  • Python
    from itertools import accumulate, groupby, repeat
    def summarize(n, _): return int("".join(str(len(list(g)))+k for k, g in groupby(str(n))))
    def aupton(terms): return list(accumulate(repeat(0, terms), summarize))
    print(aupton(11)) # Michael S. Branicky, Jun 28 2022

A001151 Describe the previous term! (method A - initial term is 8).

Original entry on oeis.org

8, 18, 1118, 3118, 132118, 1113122118, 311311222118, 13211321322118, 1113122113121113222118, 31131122211311123113322118, 132113213221133112132123222118, 11131221131211132221232112111312111213322118, 31131122211311123113321112131221123113111231121123222118
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			E.g. the term after 3118 is obtained by saying "one 3, two 1's, one 8", which gives 132118.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • Maple
    freq := proc(i,L)
        local f,p ;
        if i > nops(L) or i < 1 then
            return 0 ;
        end if;
        f := 1 ;
        for p from i to 2 by -1 do
            if op(p,L) = op(p-1,L) then
                f := f+1 ;
            else
                return f;
            end if;
        end do:
        f ;
    end proc:
    read("transforms"):
    rle := proc(n)
        local inL,i,outL,f ;
        inL := convert(n,base,10) ;
        i := nops(inL) ;
        outL := [] ;
        while i>0 do
            f := freq(i,inL) ;
            if f = 0 then
                break;
            else
                outL := [op(outL),f,op(i,inL)] ;
                i := i-f ;
            end if;
        end do:
        digcatL(outL) ;
    end proc:
    A001151 := proc(n)
        option remember ;
        if n = 1 then
            8;
        else
            rle(procname(n-1)) ;
        end if;
    end proc:
    seq(A001151(n),n=1..10) ; # R. J. Mathar, Feb 11 2021
  • 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, 8][[n]]; Table[FromDigits[F[n]], {n, 1, 11}] (* Zerinvary Lajos, Jul 08 2009 *)

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 *)

A001140 Describe the previous term! (method A - initial term is 4).

Original entry on oeis.org

4, 14, 1114, 3114, 132114, 1113122114, 311311222114, 13211321322114, 1113122113121113222114, 31131122211311123113322114, 132113213221133112132123222114, 11131221131211132221232112111312111213322114, 31131122211311123113321112131221123113111231121123222114
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
A001155, A001140, A001141, A001143, A001145, A001151 and A001154 are all identical apart from the last digit of each term (the seed). This is because digits other than 1, 2 and 3 never arise elsewhere in the terms (other than at the end of each of them) of look-and-say sequences of this type (as is mentioned by Carmine Suriano in A006751). - Chayim Lowen, Jul 16 2015
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			The term after 3114 is obtained by saying "one 3, two 1's, one 4", which gives 132114.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • Haskell
    cf. Josh Triplett's program for A005051.
    import Data.List (group)
    a001140 n = a001140_list !! (n-1)
    a001140_list = 4 : map say a001140_list where
       say = read . concatMap saygroup . group . show
             where saygroup s = (show $ length s) ++ [head s]
    -- 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, 4 ][ [ n ] ];
    Table[ FromDigits[ F[ n ] ], {n, 1, 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 = 4;
    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

A001141 Describe the previous term! (method A - initial term is 5).

Original entry on oeis.org

5, 15, 1115, 3115, 132115, 1113122115, 311311222115, 13211321322115, 1113122113121113222115, 31131122211311123113322115, 132113213221133112132123222115
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
A001155, A001140, A001141, A001143, A001145, A001151 and A001154 are all identical apart from the last digit of each term (the seed). This is because digits other than 1, 2 and 3 never arise elsewhere in the terms (other than at the end of each of them) of look-and-say sequences of this type (as is mentioned by Carmine Suriano in A006751). - Chayim Lowen, Jul 16 2015
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			The term after 3115 is obtained by saying "one 3, two 1's, one 5", which gives 132115.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • 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, 5 ][ [ n ] ];
    Table[ FromDigits[ F[ n ] ], {n, 1, 11} ] (* Zerinvary Lajos, Mar 21 2007 *)

A001143 Describe the previous term! (method A - initial term is 6).

Original entry on oeis.org

6, 16, 1116, 3116, 132116, 1113122116, 311311222116, 13211321322116, 1113122113121113222116, 31131122211311123113322116, 132113213221133112132123222116
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			The term after 3116 is obtained by saying "one 3, two 1's, one 6", which gives 132116.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • 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, 6 ][ [ n ] ]; Table[ FromDigits[ F[ n ] ], {n, 1, 11} ] (* Zerinvary Lajos, Mar 21 2007 *)

A001145 Describe the previous term! (method A - initial term is 7).

Original entry on oeis.org

7, 17, 1117, 3117, 132117, 1113122117, 311311222117, 13211321322117, 1113122113121113222117, 31131122211311123113322117, 132113213221133112132123222117
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			E.g. the term after 3117 is obtained by saying "one 3, two 1's, one 7", which gives 132117.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • 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, 7][[n]]; Table[FromDigits[F[n]], {n, 1, 11}] (* Zerinvary Lajos, Jul 08 2009 *)
Showing 1-10 of 28 results. Next