%I #14 Aug 28 2021 03:19:11
%S 0,0,0,0,0,1,11,37,109,287,698,1617,3642,7985,17208,36620,77093,
%T 161027,334205,690080,1418917,2907655,5941148,12110674
%N Number of 4-divided binary words of length n.
%C See A210109 for further information.
%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("01", repeat=n))
%o print([a(n) for n in range(1, 14)]) # _Michael S. Branicky_, Aug 27 2021
%Y Cf. A210109, A210322.
%K nonn,more
%O 1,7
%A _N. J. A. Sloane_, Mar 20 2012
%E a(18)-a(24) from _Michael S. Branicky_, Aug 27 2021
|