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.

A210325 Number of 4-divided words of length n over a 3-letter alphabet.

This page as a plain text file.
%I A210325 #24 Aug 29 2021 02:00:52
%S A210325 0,0,0,0,6,56,343,1534,6067,22162,76899,257792,843616,2712241,8606426,
%T A210325 27040628,84311895
%N A210325 Number of 4-divided words of length n over a 3-letter alphabet.
%C A210325 See A210109 for further information.
%C A210325 Row sums of the following table which shows how many words of length n over a 3-letter alphabet are 4-divided in k different ways:
%C A210325 6;
%C A210325 34, 13, 9;
%C A210325 159, 75, 51, 20, 13, 17, 5, 3;
%C A210325 500, 287, 266, 130, 71, 103, 37, 35, 33, 22, 15, 14, 13, 2, 3, 1, 2;
%C A210325 - _R. J. Mathar_, Mar 25 2012
%D A210325 Computed by David Scambler, Mar 19 2012
%o A210325 (Python)
%o A210325 from itertools import product, combinations, permutations
%o A210325 def is4div(b):
%o A210325     for i, j, k in combinations(range(1, len(b)), 3):
%o A210325         divisions = [b[:i], b[i:j], b[j:k], b[k:]]
%o A210325         all_greater = True
%o A210325         for p, bp in enumerate(permutations(divisions)):
%o A210325             if p == 0: continue
%o A210325             if b >= "".join(bp): all_greater = False; break
%o A210325         if all_greater: return True
%o A210325     return False
%o A210325 def a(n): return sum(is4div("".join(b)) for b in product("012", repeat=n))
%o A210325 print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, Aug 28 2021
%Y A210325 Cf. A210109, A210324, A210326.
%K A210325 nonn,more
%O A210325 1,5
%A A210325 _N. J. A. Sloane_, Mar 20 2012
%E A210325 a(14)-a(17) from _Michael S. Branicky_, Aug 28 2021