@Dave we will use residues then i think the property of modulus 1!mod997 + 2!mod997 + 3!mod997 ...... + 997!mod997
i just proposed the solution using congruences for the case n<N can u generalize the problem using congruences if so then please post it thnanx in advance On Dec 9, 2:13 am, Dave <[email protected]> wrote: > @Ankit: So how does that work with, e.g., N = n = 997? I.e., what is > the calculation? > > Dave > > On Dec 8, 11:33 am, ankit sablok <[email protected]> wrote: > > > > > @ all the authors thanx for the suggestions actually wt i know about > > the problem is i think we can solve the problem mathematically if we > > know about congruences > > > for instance > > if N=100 > > 1! + 2! + ......... + 100! > > and n=12 > > > we find that > > 4!mod24=0 > > > hence the above equation reduces to the > > (1!+2!+3!)mod 12 =9 > > hence the answer is 9 > > > so can anyone write a program for this logic > > > On Dec 8, 6:19 pm, ankit sablok <[email protected]> wrote: > > > > Q) can anyboy find me the solution to this problem > > > > Given an integer N and an another integer n we have to write a program > > > to find the remainder of the following problems > > > (1! + 2! + 3! + 4! + ..................... + N!)mod(n) > > > > N<=1000000 > > > n<=1000; > > > > please help me write a program for this problem > > > thanx in advance- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
