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!)
A356679 The lexicographically earliest infinite squarefree sequence of nonnegative integers that starts with 3. 7
3, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 1, 3, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
For any integer k>2, prepending a k at the beginning of this sequence gives the corresponding least word beginning k,3.
After the first 14070 letters, this becomes the image of the sequence A356676 under the ruler morphism, n->0(n+1).
From Jianing Song, Nov 28 2022: (Start)
The lexicographically earliest infinite squarefree word starting with 2,3 is not obtained by prepending 2 to the sequence: denote the corresponding sequence by {b(n)}. We have b(n) = a(n-1) for 2 <= n <= 521, but then we have a(1..260) = a(262..521) and a(261) = 2, which means that b(522) > a(521) (otherwise b(1..261) = b(262..522)). Actually, a(521) = 0 and b(522) = 1.
a(3768) is the first term equal to 4, and a(4768) is the first term equal to 5. (End)
LINKS
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 A356679
def A356679_list(n):
return build_square_free([3], n)
(PARI) issquareword(v) = my(n=#v); for(i=1, n\2, if(v[n-2*i+1..n-i] == v[n-i+1..n], return(1))); return(0)
the_first_N_terms(N) = my(v=vector(N)); v[1]=3; for(n=2, N, for(k=0, oo, v[n]=k; if(!issquareword(v[1..n]), break()))); v \\ Jianing Song, Nov 28 2022
CROSSREFS
Cf. A356676.
Other word starts: A007814 (w=0), A356677 (w=1), A356678 (w=2), this sequence (w=3), A356680 (w=1,2), A356681 (w=1,3), A356682 (w=2,1).
Sequence in context: A331569 A341716 A216600 * A356681 A093684 A101270
KEYWORD
nonn
AUTHOR
Joey Lakerdas-Gayle, Oct 18 2022
EXTENSIONS
Name edited by N. J. A. Sloane, Nov 26 2022
STATUS
approved

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 April 27 18:09 EDT 2024. Contains 372020 sequences. (Running on oeis4.)