login
A371719
Number of length-n strongly factor-symmetric binary words.
1
1, 2, 4, 6, 10, 14, 22, 26, 38, 42, 58, 62, 78, 82, 110, 106, 130, 134, 166, 162, 190, 190, 238, 226, 254, 250, 318, 294, 330, 330, 378, 366, 418, 406, 490, 430, 486, 486, 586, 538, 570, 574, 650, 618, 690, 646, 786, 714, 766, 742, 870, 818, 890, 858, 966, 874, 970
OFFSET
0,2
COMMENTS
Suppose w is a word with p 0's and q 1's. Let d(i,j) denote the number of distinct blocks in w having exactly i 0's and j 1's, for 0<=i<=p and 0<=j<=q. Then w is said to be strongly factor symmetric if d(p-i,q-j) = d(i,j) for all i and j.
a(n) is even for n > 0 by symmetry. - Michael S. Branicky, Apr 04 2024
LINKS
EXAMPLE
For example, for n = 5, the word 00101 is strongly-factor symmetric.
PROG
(Python)
from itertools import product
from collections import defaultdict
def sfs(w): # is strongly factor symmetric
p, q, d = w.count('0'), w.count('1'), defaultdict(lambda: set())
d[0, 0] = set([""])
for b in range(len(w)):
for e in range(b+1, len(w)+1):
i, j = w[b:e].count('0'), w[b:e].count('1')
d[i, j].add(w[b:e])
return all(len(d[p-i, q-j])==len(d[i, j]) for i in range(p+1) for j in range(q+1))
def a(n):
if n == 0: return 1
return 2*sum(1 for w in product("01", repeat=n-1) if sfs("0"+"".join(w)))
print([a(n) for n in range(17)]) # Michael S. Branicky, Apr 04 2024
CROSSREFS
Sequence in context: A103445 A001747 A048670 * A333315 A307889 A239951
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Apr 04 2024
EXTENSIONS
a(21)-a(27) from Michael S. Branicky, Apr 04 2024
a(28)-a(56) from Bert Dobbelaere, Apr 06 2024
STATUS
approved