Skip to content

Instantly share code, notes, and snippets.

View jmejia's full-sized avatar

Josh Mejia jmejia

  • Highwing
  • Denver, CO
View GitHub Profile
@pjc
pjc / euler7.rb
Created July 1, 2012 22:44
Euler Project in Ruby - Problem 7
def prime? x
(2..x-1).each { |y| return false if x % y == 0 }
true
end
x = 10_001 # We look for 10 001st prime number
n = 3 # Start at 3 so we can skip even numbers
counter = 1 # Counter at 1 because 2 is prime number
while true