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.

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

This page as a plain text file.
%I A210322 #13 Aug 28 2021 03:19:24
%S A210322 0,0,0,0,0,0,0,0,6,36,150,464,1304,3349,8213,19230,43867,97644,213776,
%T A210322 461240,984603,2082436
%N A210322 Number of 5-divided binary words of length n.
%C A210322 See A210109 for further information.
%D A210322 Computed by David Scambler, Mar 19 2012
%o A210322 (Python)
%o A210322 from itertools import product, combinations, permutations
%o A210322 def is5div(b):
%o A210322     for i, j, k, l in combinations(range(1, len(b)), 4):
%o A210322         divisions = [b[:i], b[i:j], b[j:k], b[k:l], b[l:]]
%o A210322         all_greater = True
%o A210322         for p, bp in enumerate(permutations(divisions)):
%o A210322             if p == 0: continue
%o A210322             if b >= "".join(bp): all_greater = False; break
%o A210322         if all_greater: return True
%o A210322     return False
%o A210322 def a(n): return sum(is5div("".join(b)) for b in product("01", repeat=n))
%o A210322 print([a(n) for n in range(1, 13)]) # _Michael S. Branicky_, Aug 27 2021
%Y A210322 Cf. A210109, A210321.
%K A210322 nonn,more
%O A210322 1,9
%A A210322 _N. J. A. Sloane_, Mar 20 2012
%E A210322 a(17)-a(22) from _Michael S. Branicky_, Aug 27 2021