Skip to main content
2 of 3
added 719 characters in body
xnor
  • 146.6k
  • 26
  • 279
  • 652

Python 2, 34 bytes

lambda n:range(1,n,2)+range(0,n,2)

Try it online!

Python 2, 38 bytes

lambda n:(range(n)+range(~n%2,n))[::2]

Try it online!

Python 2, 40 bytes

lambda n:[(k-~k)%(n|1)for k in range(n)]

Try it online!

xnor
  • 146.6k
  • 26
  • 279
  • 652