1

I saw in other posts people asking how to know if a combination is odd or even, but in my case the formula for the combination is a little bit different:

$$C(n,k) = \frac{(n+k-1)!}{k!(n-1)!}$$

Can I check if the result is odd or even without calculate the value ? I have the factorials pre-calculated with mod $10^9+7$, and if I use the values in the formula, results in a wrong answer.

Max value of N = 664579

Max value of K = 10000000

Jean-Claude Arbaut
  • 23,601
  • 7
  • 53
  • 88
  • https://en.wikipedia.org/wiki/Legendre's_formula But also have a look at this and this question:http://math.stackexchange.com/questions/233269/odd-and-even-numbers-in-pascals-triangle-sierpinskis-triangle – Jean-Claude Arbaut Apr 06 '16 at 13:06
  • This site uses Latex language.Follow this link for more details-http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – Soham Apr 06 '16 at 13:09
  • I think that is correct. I have to count how many different numbers can generate multiplying K primes and I have N distinct primes. – Gabriel Duarte Apr 06 '16 at 13:17
  • See binomial coefficient on Wikipedia, as well as stars and bars and multiset. What you write $C(n,k)$ is the number of combinations with repetitions. Usually, in France and a number of other countries, $C_n^k$ is the number of combinations without repetitions, hence your notation is a bit misleading. – Jean-Claude Arbaut Apr 06 '16 at 13:17

1 Answers1

-1

Actually what you are considering is $C(n+k-1,k)$ so you should just apply any formula you have for "usual combination" to this one.

pmichel31415
  • 1,217