login
Lengths of the B blocks associated with A091787.
2

%I #31 Nov 22 2022 22:36:40

%S 1,4,13,42,127,382,1149,3448,10345,31044,93133,279400,838203,2514610,

%T 7543831,22631496,67894489,203683468,611050413,1833151240,5499453721,

%U 16498361166,49495083499,148485250498,445455751497,1336367254492,4009101763477,12027305290463,36081915871390,108245747614173,324737242842520,974211728527561,2922635185582686,8767905556748059,26303716670244178,78911150010732543,236733450032197630,710200350096592891

%N Lengths of the B blocks associated with A091787.

%C The B blocks are explained in the article "A slow-growing sequence defined by an unusual occurrence". They have superscript (2).

%H F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Sloane/sloane55.html">A Slow-Growing Sequence Defined by an Unusual Recurrence</a>, J. Integer Sequences, Vol. 10 (2007), Article 07.1.2.

%e The third B-block of order 2 is B_3^{(2)}=2223222322233. Therefore, a(3)=13.

%o (Python)

%o number_of_terms=38

%o def Cn(X):

%o l=len(X)

%o cn=1

%o for i in range(1,int(l/2)+1):

%o j=i

%o while(X[l-j-1]==X[l-j-1+i]):

%o j=j+1

%o if j>=l:

%o break

%o candidate=int(j/i)

%o if candidate>cn:

%o cn=candidate

%o return cn

%o # This algorithm generates a prefix of the level-3 Gijswijt sequence

%o def Generate_A3(number):

%o glue_lengths=[]

%o A3=[3]

%o S=[3]

%o i=0

%o while(True):

%o c=Cn(A3)

%o if c<3:

%o glue_lengths.append(len(S))

%o i=i+1

%o if i==number:

%o break

%o S=[]

%o A3.append(max(c,3))

%o S.append(max(c,3))

%o return glue_lengths

%o glue_lengths=Generate_A3(number_of_terms-1)

%o beta_lengths=[1]

%o beta_length=1

%o for l in glue_lengths:

%o beta_length=3*beta_length+l

%o beta_lengths.append(beta_length)

%o print(beta_lengths)

%Y Cf. A091787, A357068.

%K nonn

%O 1,2

%A _Levi van de Pol_, Sep 10 2022

%E By special permission, more than the usual number of terms are shown. - _N. J. A. Sloane_, Oct 23 2022