Re: listing factors of a number

2010-03-24 Thread Glen Rubin
it looks like that code will suffice. Thanks!! On Mar 23, 9:38 pm, Per Vognsen per.vogn...@gmail.com wrote: I'm sure that code would be useful if he were looking for a slow implementation of a slow algorithm. I believe he asked for an optimized algorithm. An example might be Lenstra's

Re: listing factors of a number

2010-03-24 Thread Mark Engelberg
Check out clojuratica. It interfaces Clojure to a free version of mathematica which has a very fast implementation called FactorInteger. --Mark -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: listing factors of a number

2010-03-24 Thread Glen Rubin
Except Mathematica is kind of expensive $250 for the home edition. It looks like there is also Incanter which is a similar project using R free statistical computing environment On Mar 24, 12:55 pm, Mark Engelberg mark.engelb...@gmail.com wrote: Check out clojuratica.  It interfaces Clojure to

Re: listing factors of a number

2010-03-24 Thread Mark Engelberg
Like I said, Clojuratica works with the free edition of Mathematica: http://www.wolfram.com/products/player/ I found it tricky to get it all set up the first time, but it is definitely nice to have access to some of those really fast Mathematica functions. On Wed, Mar 24, 2010 at 3:57 PM, Glen

listing factors of a number

2010-03-23 Thread Glen Rubin
Does anyone know of any existing libraries for clojure that has code which is optimized to list all of the factors of any given integer? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note

Re: listing factors of a number

2010-03-23 Thread kotor
On Mar 23, 1:02 pm, Glen Rubin rubing...@gmail.com wrote: Does anyone know of any existing libraries for clojure that has code which is optimized to list all of the factors of any given integer? (defn factors [x] integer - vector[integers] (loop [xf [] i 2] (if ( (* i i) x) (vec

Re: listing factors of a number

2010-03-23 Thread Per Vognsen
I'm sure that code would be useful if he were looking for a slow implementation of a slow algorithm. I believe he asked for an optimized algorithm. An example might be Lenstra's elliptic curve factorization or the general number field sieve. I don't know of any implementations in Clojure but there