Skip to content

Instantly share code, notes, and snippets.

@RedSoxFan22
Created June 24, 2015 15:56
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 RedSoxFan22/c3d39d9cc2b4a2cc8c47 to your computer and use it in GitHub Desktop.
Save RedSoxFan22/c3d39d9cc2b4a2cc8c47 to your computer and use it in GitHub Desktop.
def primes(num)
array = []
1..num do |n|
array << n
end
array.reject {|x| if x.is_prime? = false }
end
def is_prime?(n)
if n % 2 == 0 && n % 3 == 0 & n % 5 == 0
true
else
false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment