Firstly this is not my homework ..I am stuck on a question during my practice.
I want to compute the value of this expression: ans=(2^huge)%p..
where:
huge=n1Ck1+ n2Ck2 +n3Ck3 ..... [n1,n2.. can be as large as 10^4 and k1,k2.. are less than 10]
p=a prime number less than 2^32
I know how to find out (a^b)%p using fast right to left binary method , but my problem is how to find the combination [nCk] of a numbers like 10000C9 that can result in such a huge number and then later use that in the modular exponentiation method ??