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.

A210326 Number of 5-divided words of length n over a 3-letter alphabet.

This page as a plain text file.
%I A210326 #21 Aug 28 2021 12:45:53
%S A210326 0,0,0,0,0,0,15,166,1135,5865,26170,105224,396082,1419981,4916112
%N A210326 Number of 5-divided words of length n over a 3-letter alphabet.
%C A210326 See A210109 for further information.
%C A210326 Row sums of the following table which shows how many words of length n over a 3-letter alphabet are 5-divided in k>=1 different ways:
%C A210326 15;
%C A210326 103,43,20;
%C A210326 546,236,162,84,28,51,16,8,5;
%C A210326 2118,1211,848,480,...
%C A210326 - _R. J. Mathar_, Mar 25 2012
%D A210326 Computed by David Scambler, Mar 19 2012
%o A210326 (Python)
%o A210326 from itertools import product, combinations, permutations
%o A210326 def is5div(b):
%o A210326     for i, j, k, l in combinations(range(1, len(b)), 4):
%o A210326         divisions = [b[:i], b[i:j], b[j:k], b[k:l], b[l:]]
%o A210326         all_greater = True
%o A210326         for p, bp in enumerate(permutations(divisions)):
%o A210326             if p == 0: continue
%o A210326             if b >= "".join(bp): all_greater = False; break
%o A210326         if all_greater: return True
%o A210326     return False
%o A210326 def a(n): return sum(is5div("".join(b)) for b in product("012", repeat=n))
%o A210326 print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, Aug 28 2021
%Y A210326 Cf. A210109, A210324, A210325.
%K A210326 nonn,more
%O A210326 1,7
%A A210326 _N. J. A. Sloane_, Mar 20 2012
%E A210326 a(14)-a(15) from _Michael S. Branicky_, Aug 28 2021