OFFSET
1,2
LINKS
Jon Maiga, Computer-generated formulas for A179674, Sequence Machine.
Jeffrey Shallit, Hamming distance for conjugates, Discrete Mathematics 309(12): 4197-4199 (2009).
FORMULA
a(n) = n * A226893(n) [uncovered by sequencedb.net]. - Falk Hüffner, Aug 15 2021
EXAMPLE
For n = 3 the a(3) = 6 solutions are all 8 strings except 000, 111.
PROG
(Python)
from itertools import product
def h(w, x): return sum(1 for wi, xi in zip(w, x) if wi != xi)
def ok(w):
return any(h(w, w[s:]+w[:s]) == 2 for s in range(1, len(w)))
def a(n):
return 2*sum(1 for p in product("01", repeat=n-1) if ok("0"+"".join(p)))
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Mar 14 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Jan 09 2011
EXTENSIONS
a(18)-a(40) from Falk Hüffner, Jul 08 2018
a(41)-a(43) from Falk Hüffner, Aug 15 2021
STATUS
approved