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.

A323487 Number of length-n ternary words that are bi-maximally squarefree.

This page as a plain text file.
%I A323487 #13 Sep 01 2021 03:39:54
%S A323487 0,0,0,0,0,0,6,0,0,0,0,0,0,0,6,0,0,0,6,0,18,0,24,0,48,42,18,12,48,78,
%T A323487 36,66,108,102,240,222,360,330,696,690,858,1086,1692,1920,2604,3156,
%U A323487 4284,5370,7308,9270,12036,15756,20688,26562,34500,44274,59058,75576
%N A323487 Number of length-n ternary words that are bi-maximally squarefree.
%C A323487 A word is squarefree if it contains no block of the form XX, where X is a nonempty block.  A word is bi-maximally squarefree if it cannot be extended on either the left or right to a longer squarefree word.
%C A323487 All terms are multiples of 6 due to possible renamings of letters. - _Michael S. Branicky_, Sep 01 2021
%e A323487 For n = 7 the six possibilities are 0102010 and all renamings of the letters.
%e A323487 For n = 15 the six possibilities are 010210120102101 and all renamings of the letters.
%o A323487 (Python)
%o A323487 def isf(w): # incrementally squarefree (check factors ending in last letter)
%o A323487     for l in range(1, len(w)//2 + 1):
%o A323487         if w[-2*l:-l] == w[-l:]: return False
%o A323487     return True
%o A323487 def is_bmsf(w, sfsnew): # is w bi-maximally squarefree
%o A323487     lefts, rights = [c+w for c in "123"], [w+c for c in "123"]
%o A323487     return all(x not in sfsnew for x in lefts + rights)
%o A323487 def aupton(nn):
%o A323487     alst, sfs = [], set("123")
%o A323487     for n in range(1, nn+1):
%o A323487         sfsnew = set(w+c for w in sfs for c in "123" if isf(w+c))
%o A323487         an = len([w for w in sfs if is_bmsf(w, sfsnew)])
%o A323487         alst.append(an)
%o A323487         sfs = sfsnew
%o A323487     return alst
%o A323487 print(aupton(30)) # _Michael S. Branicky_, Sep 01 2021
%Y A323487 Cf. A282212, which is the one-sided version of maximally squarefree.
%K A323487 nonn
%O A323487 1,7
%A A323487 _Jeffrey Shallit_, Jan 16 2019
%E A323487 a(31)-a(58) from _Michael S. Branicky_, Sep 01 2021