Find the remainder when 1!+2!+...+299!+300! is divided by 21

1 answer

If you note that we only need to calculate

6
s=∑ i!
n=1

or

s=873 mod 21 = 12

Because all terms 7! and beyond are divisible by 21.