Just for the fun of it, I ran into it again and its still a funny puzzle..
(a nice one to make in newlisp btw !)
The puzzle is: What is the next number in the following sequence:
1 11 21 1211 111221 312211 13112221
PS: For those who know the answer, dont post the number after 13112221
but post the number after that one ;-)
Shouldn't the sequence be this?
> 1
1
> (next 1)
"11"
> (next (next 1))
"21"
> (next (next (next 1)))
"1211"
> (next (next (next (next 1))))
"1231"
> (next (next (next (next (next 1)))))
"131221"
> (next (next (next (next (next (next 1))))))
"132231"
> (next (next (next (next (next (next (next 1)))))))
"232221"
> (next (next (next (next (next (next (next (next 1))))))))
"134211"
> (next (next (next (next (next (next (next (next (next 1)))))))))
"14131231"
[Edit: Sorry, I was thinking of a different sequence.]
This is more like it:
> "1"
"1"
> (next "1")
"11"
> (next (next "1"))
"21"
> (next (next (next "1")))
"1211"
> (next (next (next (next "1"))))
"111221"
> (next (next (next (next (next "1")))))
"312211"
> (next (next (next (next (next (next "1"))))))
"13112221"
> ;...
> (next (next (next (next (next (next (next (next "1"))))))))
"31131211131221"
thats intresting.... though im losing track after the 3th nested list ;-)
When i saw the puzzle i was directly thinking of your Roman-Number
script "http://www.newlisp.org/syntax.cgi?code/roman.lsp.txt".
Your solution is correct, thought only in your second answer ;-)
31131211131221 is the 9th sequence..
Your first answer does produce an intresting sequence, cant figure out
yet what it could be ;-)
Regards, Norman.