%I #24 Aug 29 2021 02:00:52
%S 0,0,0,0,6,56,343,1534,6067,22162,76899,257792,843616,2712241,8606426,
%T 27040628,84311895
%N Number of 4-divided words of length n over a 3-letter alphabet.
%C See A210109 for further information.
%C Row sums of the following table which shows how many words of length n over a 3-letter alphabet are 4-divided in k different ways:
%C 6;
%C 34, 13, 9;
%C 159, 75, 51, 20, 13, 17, 5, 3;
%C 500, 287, 266, 130, 71, 103, 37, 35, 33, 22, 15, 14, 13, 2, 3, 1, 2;
%C - _R. J. Mathar_, Mar 25 2012
%D Computed by David Scambler, Mar 19 2012
%o (Python)
%o from itertools import product, combinations, permutations
%o def is4div(b):
%o for i, j, k in combinations(range(1, len(b)), 3):
%o divisions = [b[:i], b[i:j], b[j:k], b[k:]]
%o all_greater = True
%o for p, bp in enumerate(permutations(divisions)):
%o if p == 0: continue
%o if b >= "".join(bp): all_greater = False; break
%o if all_greater: return True
%o return False
%o def a(n): return sum(is4div("".join(b)) for b in product("012", repeat=n))
%o print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, Aug 28 2021
%Y Cf. A210109, A210324, A210326.
%K nonn,more
%O 1,5
%A _N. J. A. Sloane_, Mar 20 2012
%E a(14)-a(17) from _Michael S. Branicky_, Aug 28 2021
|