proposed
approved
proposed
approved
editing
proposed
2, 4, 4, 10, 16, 28, 44, 90, 156, 270, 488, 886, 1620, 2986, 5460, 10120, 18890, 35284, 66290, 124964, 236040, 447460, 850492, 1620016, 3092652, 5915898, 11336182, 21760238, 41836338, 80549326, 155296862, 299788294, 579396418, 1121031734, 2171251698
Michael S. Branicky, <a href="/A327544/a327544.py.txt">Python program.</a>
Michael S. Branicky, <a href="/A327544/a327544.py.txt">Python program</a>
(Python) # see link for faster version
a(29) and beyond from Michael S. Branicky, Feb 05 2021
2, 4, 4, 10, 16, 28, 44, 90, 156, 270, 488, 886, 1620, 2986, 5460, 10120, 18890, 35284, 66290, 124964, 236040, 447460, 850492, 1620016, 3092652, 5915898, 11336182, 21760238, 41836338, 80549326, 155296862, 299788294, 579396418, 1121031734
(Python)
from itertools import product
def lrp(s): # longest repeated prefix (overlaps allowed)
for i in range(len(s)-1, 0, -1):
if s.find(s[:i], 1) >= 0: return s[:i]
return ""
def a(n):
if n == 1: return 2
c = 0
for p in product("01", repeat=n-1):
b = "1" + "".join(p)
if lrp(b) == lrp(b[::-1])[::-1]: c += 1
return 2*c
print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Feb 05 2021
approved
editing
proposed
approved
editing
proposed
Number of length-n "closable" binary words whose longest repeated suffix equals the longest repeated prefix.
A word is "closable" if its longest repeated suffix equals its longest repeated prefix. The longest repeated suffix of a word x is the longest suffix (possibly empty) that occurs at least twice as a contiguous block inside x. Alessandro De Luca observes that these are the words w , and analogously for which there is a unique letter a such that wa is a closed word (see A226452)the prefix.
For n = 5 the closable these binary words are 00000, 00100, 00110, 01001, 01010, 01100, 01101, 01110 and their reversals.
Cf. A226452.
approved
editing
proposed
approved