|
|
A267372
|
|
Lengths of iterates in A267371.
|
|
3
|
|
|
2, 3, 5, 8, 12, 19, 27, 36, 49, 63, 78, 94, 113, 133, 165, 198, 235, 273, 312, 352, 395, 439, 484, 533, 583, 648, 714, 781, 851, 922, 994, 1070, 1147, 1225, 1304, 1399, 1495, 1592, 1690, 1791, 1893, 1996, 2103, 2211, 2320, 2430, 2543, 2657, 2791, 2926, 3062, 3199, 3339, 3480, 3622, 3768, 3915, 4063, 4212, 4364
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
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]]
|
|
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]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|