OFFSET
1,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
EXAMPLE
The first 21 terms are constructed as follows:
1 _ 2 _ _ 3 _ _ _ 4 _ _ _ _ 5 _ _ _ _ _ .
1 _ _ 2 _ _ _ _ 3 _ _ _ _ _ _ .
1 _ _ _ 2 _ _ _ _ _ _ 3 .
1 _ _ _ _ 2 _ _ _ .
1 _ _ _ _ _ 2 .
1 _ _ _ _ .
1 _ _ _ .
1 _ _ .
1 _ .
1 .
1 1 2 1 1 3 2 1 1 4 2 1 3 1 5 2 1 1 2 3 .
PROG
(Python)
seq = []
b = 2
for n in range(1, 100):
seq += [n] + [-1] * n
while -1 in seq:
i = seq.index(-1)
seq[i] = 1
k = 2
blanks = b
for s in range(i + 1, len(seq)):
if seq[s] == -1:
blanks -= 1
if blanks < 0:
seq[s] = k
blanks = k * b
k += 1
b += 1
print(seq)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jan Koornstra, Aug 21 2019
STATUS
approved