Find the rule and continue this sequence of digits:
1235813941213533488671216141383377554...
Is there a limit to the number of times in a row a digit can appear?
(In reply to
First 20,001 digits by Charlie)
That came from
s$ = "12"
p = 1
DO
t = VAL(MID$(s$, p, 1)) + VAL(MID$(s$, p + 1, 1))
s$ = s$ + LTRIM$(STR$(t))
p = p + 1: PRINT p;
LOOP UNTIL LEN(s$) > 20000
OPEN "longstr.txt" FOR OUTPUT AS #2
DO
PRINT #2, LEFT$(s$, 100)
s$ = MID$(s$, 101)
LOOP UNTIL s$ = ""
CLOSE
111111 occurs beginning at positions 12,463, 13,928 and 17,290.
22222 occurs beginning at positions 16,044 and 17,858.
Added: The first occurrence of 111111 results from a sequence 4747; the other two from sequences of 1010101
The strings of 5 2's come from the strings of 6 1's.
Edited on June 28, 2005, 1:49 pm
|
Posted by Charlie
on 2005-06-28 13:41:15 |