17 Mar '10 20:48>
What row of numbers comes next in this series?
1
11
21
1211
111221
312211
13112221
1
11
21
1211
111221
312211
13112221
Originally posted by iamatigercan anyone go one step further can give entry 11?
This perl script outputs the first 10:
my ($num,$last) = (1,10);
for (my $n=1; $n<=$last; $n++) {
print "entry $n is $num \n";
my ($newnum, $lastchar, $count) = ('','',1);
foreach my $char (split //, $num) {
($lastchar = $char, next) unless $lastchar;
($count++, next) if $char eq $lastchar;
...[text shortened]... 12221
entry 8 is 1113213211
entry 9 is 31131211131221
entry 10 is 13211311123113112211
Originally posted by sloppybOr more succinctly, the answer to this series is that entry n is a description of n-1.
can anyone go one step further can give entry 11?
Originally posted by sloppybJust edit the 10 in the first line of the script to 20 or whatever:
can anyone go one step further can give entry 11?