OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Claire Levaillant, Wilson's theorem modulo p^2 derived from Faulhaber polynomials, arXiv:1912.06652 [math.CO], 2019.
Zhi-Hong Sun, Congruences concerning Bernoulli numbers and Bernoulli polynomials, Discrete Applied Math. 105 (2000) 193 - 223.
MAPLE
f:= proc(n) local p, p3, k, r;
p:= ithprime(n);
p3:= p^3;
r:= 1:
for k from 1 to p-1 do
r:= r*k mod p3
od;
r
end proc:
map(f, [$1..100]); # Robert Israel, Dec 18 2019
MATHEMATICA
Mod[(#-1)!, #^3]&/@Prime[Range[40]] (* Harvey P. Dale, Jan 09 2024 *)
PROG
(PARI) a(n) = my(p=prime(n)); (p-1)! % p^3;
(Magma) [Factorial(p-1)mod p^3: p in PrimesUpTo(170)]; // Marius A. Burtea, Dec 18 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Dec 17 2019
STATUS
approved