cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A210321 Number of 4-divided binary words of length n.

This page as a plain text file.
%I A210321 #14 Aug 28 2021 03:19:11
%S A210321 0,0,0,0,0,1,11,37,109,287,698,1617,3642,7985,17208,36620,77093,
%T A210321 161027,334205,690080,1418917,2907655,5941148,12110674
%N A210321 Number of 4-divided binary words of length n.
%C A210321 See A210109 for further information.
%D A210321 Computed by David Scambler, Mar 19 2012
%o A210321 (Python)
%o A210321 from itertools import product, combinations, permutations
%o A210321 def is4div(b):
%o A210321     for i, j, k in combinations(range(1, len(b)), 3):
%o A210321         divisions = [b[:i], b[i:j], b[j:k], b[k:]]
%o A210321         all_greater = True
%o A210321         for p, bp in enumerate(permutations(divisions)):
%o A210321             if p == 0: continue
%o A210321             if b >= "".join(bp): all_greater = False; break
%o A210321         if all_greater: return True
%o A210321     return False
%o A210321 def a(n): return sum(is4div("".join(b)) for b in product("01", repeat=n))
%o A210321 print([a(n) for n in range(1, 14)]) # _Michael S. Branicky_, Aug 27 2021
%Y A210321 Cf. A210109, A210322.
%K A210321 nonn,more
%O A210321 1,7
%A A210321 _N. J. A. Sloane_, Mar 20 2012
%E A210321 a(18)-a(24) from _Michael S. Branicky_, Aug 27 2021