%I #15 Feb 09 2016 20:53:56
%S 1,2,2,2,4,4,6,4,8,8,10,8,12,8,8,8,16,16,16,16,18,16,20,24,20,16,16,
%T 16,16,16,24,32,32,32,32,32,32,32,34,36,34,32,36,40,44,48,44,40,36,32,
%U 32,32,32,32,32,32,32,32,40,48,56,64,64,64,64,64,64,64,64
%N Number of closed factors of length n in Thue-Morse sequence A010060.
%H Lars Blomberg, <a href="/A268241/b268241.txt">Table of n, a(n) for n = 1..10000</a>
%H Luke Schaeffer, Jeffrey Shallit, <a href="http://www.combinatorics.org/ojs/index.php/eljc/article/view/v23i1p25">Closed, Palindromic, Rich, Privileged, Trapezoidal, and Balanced Words in Automatic Sequences</a>, Electronic Journal of Combinatorics 23(1) (2016), #P1.25.
%F Th. 2 of Schaeffer-Shallit gives explicit formula.
%F For n >= 8 and integer k >= -1
%F a) if (15*2^k < n <= 18*2^k) then a(n) = 2^(k+4);
%F b) if (18*2^k < n <= 19*2^k) then a(n) = 2*n - 20*2^k - 2;
%F c) if (19*2^k < n <= 20*2^k) then a(n) = 56*2^k - 2*n + 2;
%F d) if (20*2^k < n <= 22*2^k) then a(n) = 4*n - 64*2^k - 4;
%F e) if (22*2^k < n <= 24*2^k) then a(n) = 112*2^k - 4*n + 4;
%F f) if (24*2^k < n <= 28*2^k) then a(n) = 2^(k+4);
%F g) if (28*2^k < n <= 30*2^k) then a(n) = 8*n - 208*2^k - 8;
%e For n=40 we must select k=1 and equation c) so a(40) = 56*2^k - 2*n + 2 = 56*2^1 - 2*40 + 2 = 34.
%e For n=41 we must select k=1 and equation d) so a(41) = 4*n - 64*2^k - 4 = 4*41 - 64*2^1 - 4 = 32.
%Y Cf. A010060.
%K nonn
%O 1,2
%A _N. J. A. Sloane_, Feb 06 2016
%E More terms from _Lars Blomberg_, Feb 09 2016