Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #8 Jun 12 2017 07:09:10
%S 0,0,3,15,63,213,687,2127,6483,19575,58905,176943,531177,1593981,
%T 4782513,14348289,43045923,129139119,387419097,1162259637,3486782013,
%U 10460350023,31381055463,94143173409
%N Number of ternary squareful words of length n.
%F a(n) = A000244(n) - A006156(n).
%t nmax = 23; 3^Range[0, nmax] - Length /@ NestList[ DeleteCases[ Flatten[ Outer[ Append, #, {1, 2, 3}, 1], 1], {___, x__, x__, ___}] &, {{}}, nmax] (* _Jean-François Alcover_, Jun 12 2017, using _Vladimir Reshetnikov_'s code for A006156 *)
%Y Cf. A000244, A006156.
%K nonn
%O 0,3
%A _Mats Granvik_, Dec 18 2009