[go: up one dir, main page]

login
Revision History for A327544 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Number of length-n binary words whose longest repeated suffix equals the longest repeated prefix.
(history; published version)
#13 by N. J. A. Sloane at Fri Feb 05 00:48:57 EST 2021
STATUS

proposed

approved

#12 by Michael S. Branicky at Fri Feb 05 00:47:26 EST 2021
STATUS

editing

proposed

#11 by Michael S. Branicky at Fri Feb 05 00:47:20 EST 2021
DATA

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

#10 by Michael S. Branicky at Fri Feb 05 00:06:33 EST 2021
LINKS

Michael S. Branicky, <a href="/A327544/a327544.py.txt">Python program.</a>

#9 by Michael S. Branicky at Fri Feb 05 00:04:02 EST 2021
LINKS

Michael S. Branicky, <a href="/A327544/a327544.py.txt">Python program</a>

PROG

(Python) # see link for faster version

EXTENSIONS

a(29) and beyond from Michael S. Branicky, Feb 05 2021

#8 by Michael S. Branicky at Fri Feb 05 00:00:40 EST 2021
DATA

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

PROG

(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

STATUS

approved

editing

#7 by Susanna Cuyler at Wed Sep 18 07:50:31 EDT 2019
STATUS

proposed

approved

#6 by Jeffrey Shallit at Wed Sep 18 03:32:42 EDT 2019
STATUS

editing

proposed

#5 by Jeffrey Shallit at Wed Sep 18 03:31:55 EDT 2019
NAME

Number of length-n "closable" binary words whose longest repeated suffix equals the longest repeated prefix.

COMMENTS

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.

EXAMPLE

For n = 5 the closable these binary words are 00000, 00100, 00110, 01001, 01010, 01100, 01101, 01110 and their reversals.

CROSSREFS

Cf. A226452.

STATUS

approved

editing

Discussion
Wed Sep 18
03:32
Jeffrey Shallit: Changes made because the claim by Alessandro De Luca was wrong, and hence the original name was inappropriate.
#4 by N. J. A. Sloane at Tue Sep 17 13:38:24 EDT 2019
STATUS

proposed

approved