Question: Langford sequence

Hello,

Paraphrasing:

https://en.m.wikipedia.org/wiki/Langford_pairing

given a sequence of 2n numbers 1,1,2,2,3,3,...n,n in which the two 1's are 1 slot apart, the two 2's are 2 slots apart, the two 3's are 3 slots apart, -> generally the two n's are n slots apart.

for n=3, a possible sequence is [2,3,1,2,1,3]. 

There is sequences for n=4,7,8...

i havent a clue how to write a maple procedure to generate a sequence for given n, but I'm hoping an expert here can.

Please Wait...