Sum of digits of a factorial

后端 未结 10 699
囚心锁ツ
囚心锁ツ 2020-12-07 10:06

Link to the original problem

It\'s not a homework question. I just thought that someone might know a real solution to this problem.

I was on

10条回答
  •  暖寄归人
    2020-12-07 10:28

    I'd attack the second problem, to compute N! mod (N+1), using Wilson's theorem. That reduces the problem to testing whether N is prime.

提交回复
热议问题