In mathematics, the look-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ... (sequence A005150 in OEIS). To generate a member of the sequence from the previous member, read off the digits of the previous member, counting the number of digits in groups of the same digit. For example:
- 1 is read off as "one 1" or 11.
- 11 is read off as "two 1s" or 21
- 21 is read off as "one 2, then one 1" or 1211
- 1211 is read off as "one 1, then one 2, then two 1s" or 111221
- 111221 is read off as "three 1s, then two 2s, then one 1" or 312211.
The look-and-say sequence was introduced and analyzed by John Conway.
So, starting from a seed and a length, the output is a nx1 cell array of strings containing the Conway's sequence.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers30
Suggested Problems
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
2153 Solvers
-
246 Solvers
-
Find out missing number from a vector of 9 elements
322 Solvers
-
422 Solvers
-
Count number of words in string
188 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!