Last active
February 22, 2018 05:08
-
-
Save veganstraightedge/98a180b9c6bc8e69d809b4889f7dba99 to your computer and use it in GitHub Desktop.
Shane's Sequence of Prime Numbers. (Every prime-th prime.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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