OFFSET
0,3
COMMENTS
LINKS
Dominic McCarty, Table of n, a(n) for n = 0..10000
MATHEMATICA
a[n_] := Mod[n!, NextPrime[n]]; Array[a, 79, 0](* for large n *) a[n_] := Block[{m = NextPrime@ n, k = p = 1}, While[k < n +1, p = Mod[p*k, m]; k++]; p]
PROG
(Python)
from functools import reduce
from sympy import nextprime
def A375277(n): return ((p:=nextprime(n))-1)*pow(reduce(lambda i, j:i*j%p, range(n+1, p), 1), -1, p)%p # Chai Wah Wu, Oct 18 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Robert G. Wilson v, Sep 18 2024
STATUS
approved