All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers > Sequences
Playing With Numbers (Posted on 2003-04-16) Difficulty: 3 of 5
What are the next two numbersin the following sequence ?

1, 11, 31, 4113, 612314, ? , ?

(Explain how you arrived at your result).

See The Solution Submitted by Ravi Raja    
Rating: 3.8750 (8 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution mathematica code (spoiler) | Comment 6 of 8 |
    here is a mathematica function that generates the sequence to a give number of terms

Seq[num_]:=(
      arr={1};
      For[n=1,n\[LessEqual]num,n++,
        x=
          FromDigits[
            Flatten[Table[IntegerDigits[arr[[i]]],{i,1,Length[arr]}]]];
        dc=DigitCount[x];
        dc=RotateRight[dc];
        nxt={};
        For[t=0,t\[LessEqual]9,t++,
          cnt=dc[[t+1]];
          If[cnt\[NotEqual]0,
            nxt=Flatten[Append[nxt,IntegerDigits[cnt]]];
            nxt=Append[nxt,t];
            ];
          ];
        arr=Append[arr,FromDigits[nxt]];
        ];
      Return[arr];
      );

I did have to make one assumption and that is if 0's are encountered (which they are in the 9th term) then 0's are counted at the begining before 1's.  But I think that assumption is fairly valid.

here are the first ten terms using this function

<img src="file:///C:/DOCUME%7E1/Owner/LOCALS%7E1/Temp/moz-screenshot-3.jpg" alt=""><img src="file:///C:/DOCUME%7E1/Owner/LOCALS%7E1/Temp/moz-screenshot-4.jpg" alt="">1)     1
2)     11
3)     31
4)     4113
5)     612314
6)     8112332416
7)     1113253342618
8)     151528344153628
9)     1817210364454648
10)   102118211310455661768

  Posted by Daniel on 2006-06-27 10:01:10
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information