Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Mar 14 2015 20:29:52
%S 1,2,4,5,9,14,27,46,91,162,323,589,1177,2179,4357,8152,16303,30746,
%T 61491,116689,233377,445095,890189,1704795,3409589,6552379,13104757,
%U 25258601,50517201,97617061,195234121,378098956,756197911,1467343306,2934686611,5704370761
%N Number of n-length words w over binary alphabet such that for every prefix z of w we have #(z,a_i) = 0 or #(z,a_i) >= #(z,a_j) for all j>i and #(z,a_i) counts the occurrences of the i-th letter in z.
%H Alois P. Heinz, <a href="/A213290/b213290.txt">Table of n, a(n) for n = 0..1000</a>
%F a(n) = A001405(n) + A001405(n-2) + A057427(n).
%F a(n) = A182172(n,2) + A182172(n-2,2) + A057427(n).
%e a(0) = 1: the empty word.
%e a(1) = 2: a, b for alphabet {a,b}.
%e a(2) = 4: aa, ab, ba, bb.
%e a(3) = 5: aaa, aab, aba, baa, bbb.
%e a(4) = 9: aaaa, aaab, aaba, aabb, abaa, abab, baaa, baab, bbbb.
%e a(5) = 14: aaaaa, aaaab, aaaba, aaabb, aabaa, aabab, aabba, abaaa, abaab, ababa, baaaa, baaab, baaba, bbbbb.
%p b:= n-> `if`(n<0, 0, binomial(n, ceil(n/2))):
%p a:= n-> b(n) +b(n-2) +`if`(n>0, 1, 0):
%p seq(a(n), n=0..40);
%Y Column k=2 of A213276.
%Y Cf. A001405, A057427, A182172.
%K nonn
%O 0,2
%A _Alois P. Heinz_, Jun 08 2012