login

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”).

Number of 5-divided binary words of length n.
2

%I #13 Aug 28 2021 03:19:24

%S 0,0,0,0,0,0,0,0,6,36,150,464,1304,3349,8213,19230,43867,97644,213776,

%T 461240,984603,2082436

%N Number of 5-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 is5div(b):

%o for i, j, k, l in combinations(range(1, len(b)), 4):

%o divisions = [b[:i], b[i:j], b[j:k], b[k:l], b[l:]]

%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(is5div("".join(b)) for b in product("01", repeat=n))

%o print([a(n) for n in range(1, 13)]) # _Michael S. Branicky_, Aug 27 2021

%Y Cf. A210109, A210321.

%K nonn,more

%O 1,9

%A _N. J. A. Sloane_, Mar 20 2012

%E a(17)-a(22) from _Michael S. Branicky_, Aug 27 2021