title: Project Euler #3 in Ruby
body: <p>Project Euler Problem#3:</p>
  
  <p>The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?</p>
  
  <pre><code>def is_prime?(number)
      prime = true
      (2...number).each { |x|
          prime = false if number % x == 0
      }
      prime
  end
  
  def largest_prime(number)
      primes = []
      (number.downto(1)).each {|x|
          primes.push(x) if number % x == 0 &amp;&amp; is_prime?(x)
          break if primes.count == 1
      }
      primes[0]
  end
  </code></pre>
  
  <p>My answer is written in Ruby.  The code works for smaller numbers but not larger, can anyone explain what exactly is going on and how to get around it?  I've seen other people with this issue -- sorry to repost -- but I'm a programming newb and I don't truly understand their answers, also haven't seen any other posts answering in Ruby.  Thanks!</p>