Re: [algogeeks] Re: Problem of calculating large binomial coefficients which large base so lucas theorem cant be applied

2011-11-06 Thread pankajsingh
Thanks Dave, but i want some more efficient in my case, something like O(k) to calculate all mC1 mC2...mCk, i already had a worst time O(k^2), i.e for (long long int i1=1;i1<=k;i1++) { while((result*(m-i1+1))%i1) { result=result+17; } result=(result*( m-i1+1)); result /= i1; result=result

[algogeeks] Re: Problem of calculating large binomial coefficients which large base so lucas theorem cant be applied

2011-11-06 Thread Dave
@Pankajsingh: See the recent thread "Modular arithmetic + Combinatorics" in this newsgroup. Dave On Nov 6, 12:49 am, pankajsingh wrote: > i want to calculate values like (100 C 1) %17,what would be > better algorithm for it,i think lucas theorem cant be used in this > case.want s