Look-and-Say Sequence - GeeksforGeeks
Find the n'th term in Look-and-say (Or Count and Say) Sequence. The look-and-say sequence is the sequence of below integers:
1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, …
How is above sequence generated?
n'th term in generated by reading (n-1)'th term.
The first term is "1" Second term is "11", generated by reading first term as "One 1" (There is one 1 in previous term) Third term is "21", generated by reading second term as "Two 1" Fourth term is "1211", generated by reading third term as "One 2 One 1" and so on
Read full article from Look-and-Say Sequence - GeeksforGeeks
No comments:
Post a Comment