OFFSET
1,1
COMMENTS
Start with the natural numbers. Reverse the order of numbers in each pair. Skip one number. In the remainder (that is, "1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11,...") reverse the order in each triple. Skip one number. In the remainder (it starts with "4, 1, 8, 5, 6, 9, 10, 7") reverse the order in each tetrad. Skip one number. And so on.
PROG
(Python)
TOP = 100000
a = range(TOP)
for step in range(2, TOP):
..numBlocks = (len(a)-1) / step
..if numBlocks==0: break
..a = a[:(1+numBlocks*step)]
..for pos in range(1, len(a), step):
....a[pos:pos+step] = a[pos+step-1:pos-1:-1]
..print str(a[1])+', ',
..a[1:] = a[2:]
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Nov 27 2014
STATUS
approved