Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2012 20:52
Show Gist options
  • Save anonymous/2513041 to your computer and use it in GitHub Desktop.
Save anonymous/2513041 to your computer and use it in GitHub Desktop.
primes = [2]
current_number = 3
while primes.length < 10
primes.each do |p|
unless current_number % p == 0
primes.push(current_number)
end
end
current_number += 2
end
puts primes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment