Skip to content

Instantly share code, notes, and snippets.

@veganstraightedge
Last active February 22, 2018 05:08
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 veganstraightedge/98a180b9c6bc8e69d809b4889f7dba99 to your computer and use it in GitHub Desktop.
Save veganstraightedge/98a180b9c6bc8e69d809b4889f7dba99 to your computer and use it in GitHub Desktop.
Shane's Sequence of Prime Numbers. (Every prime-th prime.)
require 'prime'
output = []
current_index = 0
range = Prime.first(10000)
Prime.first(20).each do |next_prime|
output << range[current_index]
current_index += next_prime
end
pp output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment