OFFSET
1,2
LINKS
Joey Lakerdas-Gayle, Table of n, a(n) for n = 1..10000
Siddharth Berera, Andrés Gómez-Colunga, Joey Lakerdas-Gayle, John López, Mauditra Matin, Daniel Roebuck, Eric Rowland, Noam Scully, and Juliet Whidden, The lexicographically least square-free word with a given prefix, arXiv:2210.00508 [math.CO], 2022.
PROG
(Python)
# check if appending letter to the end of word introduces a square
def makes_square(word, letter):
new_word = word+[letter]
for l in range(1, len(new_word) // 2 + 1):
if new_word[-l:] == new_word[-2*l:-l]:
return True
return False
# returns a list of the first n letters of L(word)
def build_square_free(word, n):
new_word = word[:]
for i in range(n-len(word)):
next_letter = 0
while makes_square(new_word, next_letter):
next_letter += 1
new_word += [next_letter]
return new_word
# returns a list of the first n terms of A356681
def A356681_list(n):
return build_square_free([1, 3], n)
print(A356681_list(87))
CROSSREFS
KEYWORD
nonn
AUTHOR
Joey Lakerdas-Gayle, Oct 18 2022
STATUS
approved