OFFSET
0,2
FORMULA
a(0) = 0, a(1) = 2, a(2) = 2, and a(2^i + j) = 7*2^i + j-1 for i >= 0 and 2 <= j <= 2^i + 1.
EXAMPLE
For n = 3 the length-8 prefix 01101001 contains all length-3 subwords appearing in Thue-Morse, namely, {011,110,101,010,100,001}, and no shorter prefix works.
PROG
(PARI) a(n)=if(n<3, [0, 2, 7][n+1], my(i=exponent(n), N=1<<i, j=n-N); if(j<2, N>>=1; j=n-N); 7*N+j-1) \\ Charles R Greathouse IV, Apr 30 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jeffrey Shallit, Apr 19 2020
STATUS
approved