login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A267373 Lengths of prefixes occurring in the sequence of iterates defining A267371. 3

%I #18 Mar 24 2024 02:21:45

%S 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,

%T 66,67,70,71,72,76,77,78,79,95,96,97,98,101,102,103,107,108,109,110,

%U 113,114,134,135,136,137,140,141,142,146,147,148,149,152,153,165,166,199,200,201,202,205,206,207

%N Lengths of prefixes occurring in the sequence of iterates defining A267371.

%C First differences of A267372.

%H Michael S. Branicky, <a href="/A267373/b267373.txt">Table of n, a(n) for n = 1..10000</a>

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

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

%t a267373[n_] := Map[First, Rest[NestList[{preLo[#], StringJoin[#[[2]], StringTake[#[[2]], preLo[#]]]}&, {1, "01"}, n]]]

%t a267373[69] (* _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 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 yield k

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

%Y Cf. A267371, A267372.

%K nonn

%O 1,2

%A _Jeffrey Shallit_, Jan 13 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 18:58 EDT 2024. Contains 371781 sequences. (Running on oeis4.)