On Fri, Nov 11, 2011 at 11:46 PM, Ja xv <jeniferjblack / hotmail.com> wrote:
> question:
> How would you write the code to find the prime factors of a very large
> number?
>
> I think one of the factors is small (ie) less than 1000
> the code I have written is:

<snip/>

> ##I need help in writing the code, am I on the right track?

I am not sure what you are looking for: are you looking for feedback
on your specific code or are you looking for efficient prime
factorization algorithms?  In the latter, there are quire a few around
and documented, for example at

http://en.wikipedia.org/wiki/Category:Integer_factorization_algorithms

For example this one: http://en.wikipedia.org/wiki/Quadratic_sieve

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/