%I #16 Dec 30 2015 16:53:06
%S 1,3,9,27,63,141,249,435,663,969,1293,1713,2169,2751,3333,4047,4827,
%T 5733,6711,7875,9081,10437,11817,13425,15171,17091,19017,21183,23475,
%U 26001,28611,31521,34515,37755,41067,44631,48363,52389,56499,60915,65493,70419,75417
%N Number of balanced ternary words of length n.
%C A word w is balanced if, for every pair of factors (consecutive blocks occurring within it) of the same length, the number of occurrences of each letter in the two factors differs by at most 1. For example, the word "banana" has this property.
%H Lars Blomberg, <a href="/A260938/b260938.txt">Table of n, a(n) for n = 0..170</a>
%e a(4) = 63, since all words of length 4 are balanced except 0011, 0012, 0021, 0022, 0122, 0211 (and renamings of those).
%Y Cf. A005598.
%K nonn
%O 0,2
%A _Jeffrey Shallit_, Aug 04 2015
%E More terms from _Lars Blomberg_, Dec 10 2015
|