Binomial improvements

bodrato at bodrato at
Sun Dec 11 12:18:52 CET 2011


Il Dom, 11 Dicembre 2011 11:24 am, bodrato at ha scritto:
> Let n be an integer. And let oddfac(n)= n! >> (n-popcount(n)) be the odd
> factor of the factorial of n. Then oddfac(n)=oddfac(floor(n/2))*(n-n%2)!!

> I.e. we can compute the product of odd numbers from 3 to n, times the odd
> numbers from 3 to n>>1, times... till we reach a tabled oddfac().

I applied basically the same idea also to compute the odd component of the
product (n-k+1)...n, you can find it in the function mpz_prodd(res,lo,hi)
that you can find in


More information about the gmp-devel mailing list