project-euler/381_prime-k_factorial.py

11 lines
158 B
Python

#!/usr/bin/env python3
from lib import primegen
def S(p):
return (9 * pow(-24, p-2, p)) % p
N = 10**8
print(sum(S(p) for p in list(primegen(N))[2:]))