What are the next two numbersin the following sequence ?
1, 11, 31, 4113, 612314, ? , ?
(Explain how you arrived at your result).
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 |