, 2010 8:10 PM
To: Algorithm Geeks
Subject: [algogeeks] Re: program for evaluation of remainders
@Ankit: Why not just use the algorithm I proposed in
http://groups.google.com/group/algogeeks/msg/2941ab071a39517c:
x = 0;
for( i = (n N ? n : N) ; i 0 ; --i )
x = (i * x + i) % n;
Dave
On Dec 10
@jai gupta
why is this work??
I think it just calculates (N+1)! %n
haxxpop
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
rem=1;
for(j=3;j=N+1;j++)
rem=(rem*j)%n;
return rem;
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to