OFFSET
0,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..10000
EXAMPLE
Starting with 01 of length 2, we append the shortest prefix occurring only once to get 010 of length 3, then again to get 01001 of length 5, etc.
MATHEMATICA
(* Function preLo[] is defined in A267371 *)
a267372[n_] := Map[StringLength[Last[#]]&, NestList[{preLo[#], StringJoin[#[[2]], StringTake[#[[2]], preLo[#]]]}&, {1, "01"}, n]]
a267372[59] (* Hartmut F. W. Hoft, Mar 22 2024 *)
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
astr, k, mink = "01", 2, 1
while True:
yield len(astr)
for k in range(mink, len(astr)+1):
if astr[1:].count(astr[:k]) == 0:
break
mink = max(mink, k)
astr += astr[:k]
print(list(islice(agen(), 60))) # Michael S. Branicky, Mar 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Jan 13 2016
STATUS
approved