login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Lengths of iterates in A267371.
3

%I #22 Mar 24 2024 07:38:27

%S 2,3,5,8,12,19,27,36,49,63,78,94,113,133,165,198,235,273,312,352,395,

%T 439,484,533,583,648,714,781,851,922,994,1070,1147,1225,1304,1399,

%U 1495,1592,1690,1791,1893,1996,2103,2211,2320,2430,2543,2657,2791,2926,3062,3199,3339,3480,3622,3768,3915,4063,4212,4364

%N Lengths of iterates in A267371.

%H Michael S. Branicky, <a href="/A267372/b267372.txt">Table of n, a(n) for n = 0..10000</a>

%e 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.

%t (* Function preLo[] is defined in A267371 *)

%t a267372[n_] := Map[StringLength[Last[#]]&, NestList[{preLo[#], StringJoin[#[[2]], StringTake[#[[2]], preLo[#]]]}&, {1, "01"}, n]]

%t a267372[59] (* _Hartmut F. W. Hoft_, Mar 22 2024 *)

%o (Python)

%o from itertools import count, islice

%o def agen(): # generator of terms

%o astr, k, mink = "01", 2, 1

%o while True:

%o yield len(astr)

%o for k in range(mink, len(astr)+1):

%o if astr[1:].count(astr[:k]) == 0:

%o break

%o mink = max(mink, k)

%o astr += astr[:k]

%o print(list(islice(agen(), 60))) # _Michael S. Branicky_, Mar 23 2024

%Y Cf. A267371, A267373.

%K nonn

%O 0,1

%A _Jeffrey Shallit_, Jan 13 2016