login
A334227
Length of the shortest prefix of the Thue-Morse sequence (A010060) containing, as subwords, all length-n blocks appearing in A010060.
1
0, 2, 7, 8, 15, 16, 29, 30, 31, 32, 57, 58, 59, 60, 61, 62, 63, 64, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246
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
Cf. A010060.
Sequence in context: A063729 A299151 A023178 * A080572 A263602 A162664
KEYWORD
nonn,easy
AUTHOR
Jeffrey Shallit, Apr 19 2020
STATUS
approved