Binomial improvements
bodrato at mail.dm.unipi.it
bodrato at mail.dm.unipi.it
Sun Dec 11 12:18:52 CET 2011
PS:
Il Dom, 11 Dicembre 2011 11:24 am, bodrato at mail.dm.unipi.it 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 http://bodrato.it/software/fac_ui.24-mar-2010.c
--
http://bodrato.it/papers/
More information about the gmp-devel
mailing list