|
|
A267373
|
|
Lengths of prefixes occurring in the sequence of iterates defining A267371.
|
|
3
|
|
|
1, 2, 3, 4, 7, 8, 9, 13, 14, 15, 16, 19, 20, 32, 33, 37, 38, 39, 40, 43, 44, 45, 49, 50, 65, 66, 67, 70, 71, 72, 76, 77, 78, 79, 95, 96, 97, 98, 101, 102, 103, 107, 108, 109, 110, 113, 114, 134, 135, 136, 137, 140, 141, 142, 146, 147, 148, 149, 152, 153, 165, 166, 199, 200, 201, 202, 205, 206, 207
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
Starting with 01, we append the shortest prefix occurring only once to get 010. This is of length 1. Next, we append the shortest prefix occurring only once (01) to get 01001. This is of length 2, and so forth.
|
|
MATHEMATICA
|
(* Function preLo[] is defined in A267371 *)
a267373[n_] := Map[First, Rest[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:
for k in range(mink, len(astr)+1):
if astr[1:].count(astr[:k]) == 0:
break
mink = max(mink, k)
astr += astr[:k]
yield k
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|