OFFSET
0,2
COMMENTS
Conjecture: If iterate m terminates with prefix s ending in 1 then the subsequent iterate of A267371 is terminated by prefix s0.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..4000
EXAMPLE
a(0) = 0 since the initial string for the iteration process is 01.
a(2) = 5 since the first 5 prefixes are 0, 01, 010, 0100 and 0100101 determining the iterate 0100101001000100101 of length 19. The next prefix in the iteration process is 01001010.
MATHEMATICA
(* function preLo[ ] is defined in A267371 *)
lastChar[n_] := Map[StringTake[Last[#], -1]&, NestList[{preLo[#], StringJoin[#[[2]], StringTake[#[[2]], preLo[#]]]}&, {1, "01"}, n]]a371440[n_] := Flatten[Position[lastChar[n], "1"]-1]a371440[200]
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
astr, k, mink = "01", 2, 1
for i in count(0):
if astr[-1] == "1": yield i
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(), 62))) # Michael S. Branicky, Mar 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Hartmut F. W. Hoft, Mar 23 2024
STATUS
approved