# Talk:Factorials with prime factorization (Python)

How to make all code end up in the same file? Fredrik 05:06, 3 March 2006 (PST)

To do: more elaborate descriptions, mention how this can be used to compute huge falling/rising factorials and binomial coefficients as well.

Perhaps create a separate article for Luschny's "swing numbers" algorithm, which seems to be the fastest. Using gmpy's mpz type instead of Python integers, my implementation of it was much faster than both gmp's and Mathematica's factorial functions. Unfortunately, I haven't figured out exactly how the algorithm works yet, and I don't want to just "translate" Luschny's code without understanding it... :\ - Fredrik 05:13, 3 March 2006 (PST)

Another thought: functions like primes() and powproduct() as used here are fairly general purpose. Perhaps they should be placed in templates... Fredrik 05:37, 3 March 2006 (PST)

- Hey Fredrik, this looks like a great article. Be careful about copyright violation though when working from sources like Luschny. I recently fixed the wiki so code can go in templates, so this trick would work (whether it's the ideal approach, I'm not sure). I've used GMP, so I might write a C or C++ version of this. Deco 12:06, 3 March 2006 (PST)
- I am fully aware of the problem of implementing algorithms based on existing implementations. That's why I wrote this code from scratch after having studied the reference material until I knew it by heart (my implementation is also based on the description in Borwein's paper). But I don't yet understand how the swing algorithm works, so I can't write the code for that one. Fredrik 14:06, 3 March 2006 (PST)