|
|
A262068
|
|
Number of binary strings of length 2n that can be written as the concatenation of one or more squares.
|
|
1
|
|
|
1, 2, 6, 22, 76, 268, 926, 3250, 11328, 39658, 138534, 484364, 1693078, 5918780, 20690230, 72328158, 252841374, 883869956, 3089791576, 10801141656
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
By a "square" we mean a word of the form xx, where x is a string, like the English word "murmur".
|
|
LINKS
|
|
|
EXAMPLE
|
For n = 2 the six words are 0000, 0011, 0101, and their complements.
|
|
MAPLE
|
for n from 1 to 13 do
B[n]:= convert(map(t-> t||t, StringTools:-Generate(n, "01")), set);
od:
C[0]:= {""}:
for n from 1 to 13 do
C[n]:= {seq(seq(seq(cat(s, t), s=B[i]), t = C[n-i]), i=1..n)};
od:
|
|
PROG
|
from numba import njit
@njit() # comment out for n >= 32
def a(n):
if n == 0: return 1 # by convention
s = 0
for b in range(int(2**(2*n-1))):
s += MS(b, n) >= 1
return 2*s
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|