Look and Say Sequence
Have no idea why it took near 2 hours for me to write this. Maybe it was the stupid OOP paper I gave today, I’ve been in a bad mood after writing a 40-pager and yet feeling unsatisfactory about it.
So back to the post’s topic: The Look and Say Sequence, which I found today while solving the level 10 of The Python Challenge, is a very odd sequence of numbers which are formed by counting and spelling out the digits sequentially.
The series looks like the following:
1 11 21 1211 111221 and so on …
How this is formed:
See the first digit 1. Spell it as One One (One in quantity that is). This is the general idea.
Thus:
1 - One One: 11
11 - Two One(s): 21
21 - One Two and One One: 1211
1211 - One One, One Two and Two One(s): 111221
And on and on and on …
And now, for the Python Code.
( Took me over 80 minutes with lots of scrapping and frustration to write. Bad day
)
Hail PytHarsh!!
YCR
29 Nov 07 at 2:46 am
What’s that?
Python programs sound better if called Py[Name] than Pyt
Harsh
29 Nov 07 at 2:55 am
Whoa thats a really strange sequence!! And i thought Fibonacci series (which I thought this was all about at first glance) was strange enough… Guess Fibonacci is much better than piece of cake compared to this….
Beta3
29 Nov 07 at 5:29 pm
@Beta3: I think you’d like to take back your words sometime soon.
There are very few things that are as strange and intriguing as the fibonacci numbers.
have a look:
http://mathworld.wolfram.com/FibonacciNumber.html
anomit
30 Nov 07 at 12:54 am
Yeah Fibonacci series gives you the golden numbers
Harsh
30 Nov 07 at 5:14 am
lol, its golden ratio not golden number
anomit
30 Nov 07 at 7:11 pm
Oops yeah, the number has something to do with calendars instead.
Harsh
30 Nov 07 at 7:52 pm