Created
June 24, 2015 15:56
-
-
Save RedSoxFan22/c3d39d9cc2b4a2cc8c47 to your computer and use it in GitHub Desktop.
This file contains 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
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