%I #19 Nov 26 2020 21:20:47
%S 1,2,3,5,7,10,13,18,24,34,44,57,76,103,133,174,232,305,398,530,691,
%T 903,1172,1533,1982,2581,3370,4404,5737,7477,9741,12687,16546,21586,
%U 28091,36586,47625,62034,80741,105111,136859,178252
%N Number of dissimilar ternary squarefree words of length n+1.
%C Cycle b-> c-> b and a-> b-> c-> a to get 6 similar words in A006156(n+1).
%D N. Wirth, Systematisches Programmieren, 1975, ch. 15.4, table 15.68
%H Robert Shelton, <a href="http://gdz.sub.uni-goettingen.de/dms/resolveppn/?PPN=GDZPPN002198088">Aperiodic words on three symbols</a>, J. Reine Angew. Math. 321 (1981), 195--209. MR0597989 (82m:05004a). See Table 1 on page 207. - _N. J. A. Sloane_, Jun 22 2014
%F a(n) = A006156(n+1)/6. [corrected by _Michel Marcus_, Nov 26 2020]
%e ab~ac (cycle b,c), ab~bc~ca and ac~ba~cb (cycle a,b,c) => a(1) = 6/6 = 1.
%t (* This program is not convenient for a large number of terms *) a[n_] := a[n] = (1/6)*Length[ DeleteCases[ Tuples[ Range[3], n + 1], {a___, b__, b__, c___}]]; Reap[ Do[ Print["a[", n, "] = ", a[n]]; Sow[a[n]], {n, 1, 12}]][[2, 1]] (* _Jean-François Alcover_, Jul 24 2013 *)
%Y Cf. A006156.
%K nonn
%O 1,2
%A _Frank Ellermann_, Apr 19 2001