A210325 Number of 4-divided words of length n over a 3-letter alphabet.
0, 0, 0, 0, 6, 56, 343, 1534, 6067, 22162, 76899, 257792, 843616, 2712241, 8606426, 27040628, 84311895
Offset: 1
References
- Computed by David Scambler, Mar 19 2012
Programs
-
Python
from itertools import product, combinations, permutations def is4div(b): for i, j, k in combinations(range(1, len(b)), 3): divisions = [b[:i], b[i:j], b[j:k], b[k:]] all_greater = True for p, bp in enumerate(permutations(divisions)): if p == 0: continue if b >= "".join(bp): all_greater = False; break if all_greater: return True return False def a(n): return sum(is4div("".join(b)) for b in product("012", repeat=n)) print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Aug 28 2021
Extensions
a(14)-a(17) from Michael S. Branicky, Aug 28 2021
Comments