Skip to content

Instantly share code, notes, and snippets.

@fxn
Created September 17, 2021 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fxn/2e1d9bdb3bc8a387e8a5e0b8e2ce50bf to your computer and use it in GitHub Desktop.
Save fxn/2e1d9bdb3bc8a387e8a5e0b8e2ce50bf to your computer and use it in GitHub Desktop.
n = 3004953
start = n/2 + 1
play = [*start..n, *1...start]
while n > 1
play.shift
play << play.shift if n.odd?
n -= 1
end
puts play
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment