← RoseCode

ROSECODE 407

Infinite String

Min_25 · Math ·

Let s0 be the string "01" and si=si1+si1[0:i] for i1, where s[0:i] means the first i characters of s.

For example, s1= "010", s2= "01001" and s3= "01001010".

Let C(i) be the number of "1" in the si[0:i].

You are given that C(10)=4,C(104)=3576 and C(108)=35807401.

Find C(1018).

[My Timing: instant]