A005150 Look and Say sequence: describe the previous term! (method A - initial term is 1).
1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, 31131211131221, 13211311123113112211, 11131221133112132113212221, 3113112221232112111312211312113211, 1321132132111213122112311311222113111221131221, 11131221131211131231121113112221121321132132211331222113112211, 311311222113111231131112132112311321322112111312211312111322212311322113212221
Offset: 1
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.
Links
- T. D. Noe, Table of n, a(n) for n = 1..25
- Henry Bottomley, Evolution of Conway's 92 Look and Say audioactive elements.
- Éric Brier, Rémi Géraud-Stewart, David Naccache, Alessandro Pacco, and Emanuele Troiani, Stuttering Conway Sequences Are Still Conway Sequences, arXiv:2006.06837 [math.DS], 2020.
- Éric Brier, Rémi Géraud-Stewart, David Naccache, Alessandro Pacco, and Emanuele Troiani, The Look-and-Say The Biggest Sequence Eventually Cycles, arXiv:2006.07246 [math.DS], 2020.
- Onno M. Cain and Sela T. Enin, Inventory Loops (i.e. Counting Sequences) have Pre-period 2 max S_1 + 60, arXiv:2004.00209 [math.NT], 2020.
- Ben Chen, Richard Chen, Joshua Guo, Tanya Khovanova, Shane Lee, Neil Malur, Nastia Polina, Poonam Sahoo, Anuj Sakarda, Nathan Sheffield, and Armaan Tipirneni, On Base 3/2 and its Sequences, arXiv:1808.04304 [math.NT], 2018.
- J. H. Conway, The weird and wonderful chemistry of audioactive decay, Eureka 46 (1986) 5-16.
- J. H. Conway, The weird and wonderful chemistry of audioactive decay, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Computation, Springer, NY 1987, pp. 173-188.
- J. H. Conway and Brady Haran, Look-and-Say Numbers (2014), Numberphile video.
- S. B. Ekhad and D. Zeilberger, Proof of Conway's Lost Cosmological Theorem, arXiv:math/9808077 [math.CO], 1998.
- S. B. Ekhad and D. Zeilberger, Proof of Conway's lost cosmological theorem, Electron. Res. Announc. Amer. Math. Soc. 3 (1997), 78-82.
- S. Eliahou and M. J. Erickson, Mutually describing multisets and integer partitions, Discrete Mathematics, Volume 313, Issue 4, Feb 28 2013, Pages 422-433. - From _N. J. A. Sloane_, Jan 03 2013
- S. R. Finch, Conway's Constant [From the Wayback Machine]
- Steven Finch, The On-Line Encyclopedia of Integer Sequences, founded in 1964 by N. J. A. Sloane, A Tribute to John Horton Conway, The Mathematical Intelligencer (2021) Vol. 43, 146-147.
- X. Gourdon and B. Salvy, Effective asymptotics of linear recurrences with rational coefficients, Discrete Mathematics, vol. 153, no. 1-3, 1996, pages 145-163. See p. 161.
- M. Hilgemeier, Die Gleichniszahlen-Reihe, in Bild der Wissenschaft, 12 (1986), 194-195, with permission from the Konradin Medien GmbH.
- M. Hilgemeier, One metaphor fits all, in Fractal Horizons, ed. C. A Pickover, St. Martins, NY, 1996, pp. 137-161.
- R. A. Litherland, Conway's Cosmological Theorem (Overview).
- R. A. Litherland, Conway's Cosmological Theorem, 12 pages, Apr 14 2006 (pdf file).
- R. A. Litherland, Programs for Conway's Cosmological Theorem, (gzipped tar ball).
- R. A. Litherland, The audioactive package.
- M. Lothaire, Algebraic Combinatorics on Words, Cambridge, 2002, see p. 37, etc.
- MacTutor History of Mathematics, John H. Conway
- O. Martin, Look-and-Say Biochemistry: Exponential RNA and Multistranded DNA, Amer. Math. Monthly, 113 (No. 4, 2006), 289-307. - From _N. J. A. Sloane_, Feb 19 2013
- Thomas Morrill, Look, Knave, arXiv:2004.06414 [math.CO], 2020.
- Paulo Ortolan, Java program for A005150.
- Matt Parker, Can you trust an elegant conjecture?, Stand-Up Maths, 2022, video.
- Rosetta Code, Look and say sequence programs in over 60 languages.
- J. Sauerberg and L. Shu, The long and the short on counting sequences, Amer. Math. Monthly, 104 (1997), 306-317.
- T. Sillke, Conway sequence.
- L. J. Upton, Letter to N. J. A. Sloane, Jan 08 1991.
- Kevin Watkins, Abstract Interpretation Using Laziness: Proving Conway's Lost Cosmological Theorem.
- Kevin Watkins, Proving Conway's Lost Cosmological Theorem, POP seminar talk, CMU, Dec 2006.
- Eric Weisstein's World of Mathematics, Look and Say Sequence.
- Wikipedia, Look-and-say sequence.
- Wikipédia, Suite de Conway.
- W. W. Zadrozny, Abstraction, Reasoning and Deep Learning: A Study of the "Look and Say" Sequence, arXiv:2109.12755 [cs.AI], 2022.
- Julia Witte Zimmerman, Denis Hudon, Kathryn Cramer, Jonathan St. Onge, Mikaela Fudolig, Milo Z. Trujillo, Christopher M. Danforth, and Peter Sheridan Dodds, A blind spot for large language models: Supradiegetic linguistic information, arXiv:2306.06794 [cs.CL], 2023.
- Julia Witte Zimmerman, Denis Hudon, Kathryn Cramer, Alejandro J. Ruiz, Calla Beauregard, Ashley Fehr, Mikaela Irene Fudolig, Bradford Demarest, Yoshi Meke Bird, Milo Z. Trujillo, Christopher M. Danforth, and Peter Sheridan Dodds, Tokens, the oft-overlooked appetizer: Large language models, the distributional hypothesis, and meaning, arXiv:2412.10924 [cs.CL], 2024. See pp. 21, 28.
Crossrefs
Cf. A001155, A006751, A006715, A001140, A001141, A001143, A001145, A001151, A001154, A007651, A060857.
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).
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
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
Comments