login
A330526
a(n) = (p-1)! mod p^3, where p = prime(n).
1
1, 2, 24, 34, 494, 675, 4419, 4008, 4944, 13136, 21730, 23531, 14103, 41236, 86432, 77644, 64250, 148534, 243209, 141005, 384490, 373985, 29215, 101281, 543102, 109281, 154396, 1122108, 965630, 1006716, 1283207, 152876, 2147337, 1419745, 1545874, 1381045, 1108262, 123879
OFFSET
1,2
LINKS
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.
FORMULA
a(n)= A177771(n) mod A030078(n).
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