login
Height of the smallest stack in a block-stacking sequence.
0

%I #14 May 10 2020 16:32:59

%S 1,3,3,3,7,6,7,8,13,10,13,12,13,15,15,15,17,21,19,21,21,21,25,24,25,

%T 27,27,27,31,30,31,32,35,34,35,39,37,39,39,39,43,42,43,44,49,46,49,48,

%U 49,51,51,51,55,54,55,56,61,58,61,60,61,63,63,63,65,69,67,69,69,69,71,75

%N Height of the smallest stack in a block-stacking sequence.

%C This sequence describes a block-stacking process: at step 1, start with a single stack of height 1. At step n>1, if n is less than or equal to the height of the smallest stack, start a new stack of height n. Otherwise, add n to the height of the smallest stack.

%o (Python)

%o def seq():

%o towers = [0]

%o for i in range(1, 100):

%o towers = sorted(towers)

%o if i <= towers[0]:

%o towers = [i] + towers

%o else:

%o towers = [towers[0] + i] + towers[1:]

%o yield min(towers)

%o (PARI) seq(n)={my(L=List(), a=vector(n)); for(n=1, #a, if(#L && L[1]<n, L[1]+=n, listput(L,n)); listsort(L); a[n]=L[1]); a} \\ _Andrew Howroyd_, Oct 22 2019

%K easy,nonn

%O 1,2

%A _Christian Perfect_, Oct 22 2019