login
Numbers k = 1, 2, 3, ... are added to the sequence along with k blanks. Next, the numbers k + 1 are inserted on the blanks along with k + 1 blanks. This process is then repeated.
1

%I #10 Aug 29 2019 20:11:22

%S 1,2,2,3,4,3,3,5,6,4,4,4,7,8,5,5,9,5,5,10,6,6,11,12,6,6,6,7,7,13,14,8,

%T 7,7,15,8,7,7,16,9,17,8,8,18,9,10,8,8,8,19,20,9,9,11,10,21,22,9,9,12,

%U 9,9,10,10,23,11,24,13,25,10,10,11,26

%N Numbers k = 1, 2, 3, ... are added to the sequence along with k blanks. Next, the numbers k + 1 are inserted on the blanks along with k + 1 blanks. This process is then repeated.

%H Jan Koornstra, <a href="/A309899/b309899.txt">Table of n, a(n) for n = 1..10000</a>

%e The first elements are:

%e 1 _ 2 _ _ 3 _ _ _ 4 _ _ _ _ 5 _ _ _ _ _

%e 2 _ _ 3 _ _ _ 4 _ _ _ _ 5 _ _

%e 3 _ _ _ 4 _ _ _ _ 5 _

%e 4 _ _ _ _ 5 _ _

%e 5 _ _ _ _ _

%e .

%e 1 2 2 3 4 3 3 5 6 4 4 4 7 8 5 5 9 5 5 10

%o (Python)

%o seq = []

%o for n in range(1, 100): seq += [n] + n*[-1]

%o for n in range(2, len(seq)):

%o value = n

%o gaps = 0

%o position = n - 1

%o while position < len(seq):

%o if seq[position] == -1:

%o if gaps > 0: gaps -= 1

%o else:

%o seq[position] = value

%o gaps = value

%o value += 1

%o position += 1

%o print(seq)

%Y Cf. A309898, A003602, A002260, A306470.

%K nonn,easy

%O 1,2

%A _Jan Koornstra_, Aug 21 2019