OFFSET
0,2
COMMENTS
An antisquare is a word of the form x x', where x' is the bitwise complement of x.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..52
EXAMPLE
For n = 4 the 12 examples are all length-4 binary words except 0011, 0110, 1001, and 1100.
PROG
(Python)
from numba import njit
@njit
def aupto(nn, v=False):
alst = [1, 2, 4, 8]
if nn <= 4: return alst[:nn+1]
n, prev_as = 4, [0, 1, 2, 3] # |w|=3, w0 = 0, no a.s.'s except 01, 10
while n <= nn:
new_as = []
for w in prev_as:
for b in [0, 1]:
wb = 2*w + b
for k in range(2, n//2+1):
mask2 = (1<<k) - 1
mask1 = mask2 << k
if (wb&mask2)^((wb&mask1)>>k)==mask2: break # wb ends with an a.s.
else: new_as.append(wb) # no break
alst.append(2*len(new_as)) # twice that starting with 0 by symmetry
if v: print(n, 2*len(new_as), alst)
prev_as = new_as
n += 1
return alst
print(aupto(30)) # Michael S. Branicky, Jan 06 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, Apr 25 2019
EXTENSIONS
a(36) and beyond from Michael S. Branicky, Jan 06 2021
STATUS
approved