login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A356682 The lexicographically earliest infinite squarefree sequence of nonnegative integers that starts with 2, 1. 6

%I #15 Jan 03 2023 09:26:04

%S 2,1,0,1,2,0,1,0,2,0,1,2,0,2,1,0,1,2,0,1,0,2,0,1,2,1,0,1,2,0,1,0,2,0,

%T 3,0,1,0,2,0,1,0,3,0,1,0,2,0,3,0,1,0,3,0,2,0,1,0,2,0,3,0,1,0,2,0,1,0,

%U 3,0,1,0,2,0,3,0,1,0,3,1,0,1,2,0,1,0,2

%N The lexicographically earliest infinite squarefree sequence of nonnegative integers that starts with 2, 1.

%H Joey Lakerdas-Gayle, <a href="/A356682/b356682.txt">Table of n, a(n) for n = 1..10000</a>

%H Siddharth Berera, Andrés Gómez-Colunga, Joey Lakerdas-Gayle, John López, Mauditra Matin, Daniel Roebuck, Eric Rowland, Noam Scully, and Juliet Whidden, <a href="https://arxiv.org/abs/2210.00508">The lexicographically least square-free word with a given prefix</a>, arXiv:2210.00508 [math.CO], 2022.

%o (Python)

%o # check if appending letter to the end of word introduces a square

%o def makes_square(word, letter):

%o new_word = word+[letter]

%o for l in range(1, len(new_word) // 2 + 1):

%o if new_word[-l:] == new_word[-2*l:-l]:

%o return True

%o return False

%o # returns a list of the first n letters of L(word)

%o def build_square_free(word, n):

%o new_word = word[:]

%o for i in range(n-len(word)):

%o next_letter = 0

%o while makes_square(new_word, next_letter):

%o next_letter += 1

%o new_word += [next_letter]

%o return new_word

%o # returns a list of the first n terms of A356682

%o def A356682_list(n):

%o return build_square_free([2,1], n)

%o print(A356682_list(87))

%Y Other word starts: A007814 (w=0), A356677 (w=1), A356678 (w=2), A356679 (w=3), A356680 (w=1,2), A356681 (w=1,3), this sequence (w=2,1).

%K nonn

%O 1,1

%A _Joey Lakerdas-Gayle_, Oct 18 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 30 05:37 EDT 2024. Contains 375526 sequences. (Running on oeis4.)