Skip to content

Instantly share code, notes, and snippets.

@leekiernan
Last active December 19, 2015 11:09
Show Gist options
  • Save leekiernan/5945248 to your computer and use it in GitHub Desktop.
Save leekiernan/5945248 to your computer and use it in GitHub Desktop.
Prime numbers Ruby
primes = (1..100).reject do |n|
!(2...n).reject { |x| n % x > 0 }.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment