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
Bert Dobbelaere, Table of n, a(n) for n = 0..120
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
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