OFFSET
1,4
COMMENTS
Concatenate segments: 1 1, then 1 2 2 2, then 1 3 2 3 3 3, so that the general segment is 1 n 2 n ... n n. This is followed by 1; thus, not only does every i,j with i <= j occur, but so does every i,j with i >= j. Every pair i,j of positive integers with i < j or i > j occurs exactly once.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10100
MATHEMATICA
t = {1, 1}; Do[t = Join[t, Riffle[Range[n], n], {n}], {n, 2, 10}];
Flatten[Partition[t, 2]]
PROG
(Python)
def auptoj(maxj):
alst = []
for j in range(1, maxj+1):
for i in range(1, j+1):
alst.extend([i, j])
return alst
print(auptoj(9)) # Michael S. Branicky, Nov 21 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Nov 20 2021
STATUS
approved