A112660 a(n) = (p-1)! mod p^2 where p = n-th prime.
1, 2, 24, 34, 10, 168, 84, 37, 183, 521, 588, 258, 655, 558, 281, 1801, 1592, 3415, 803, 4898, 802, 5766, 1659, 6229, 6789, 7271, 5870, 106, 3269, 10734, 9016, 15588, 7671, 9312, 14005, 12985, 23706, 17603, 3506, 18337, 8591, 13031, 30368, 6754, 28958, 23481, 36502, 40139
Offset: 1
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Claire Levaillant, Wilson's theorem modulo p^2 derived from Faulhaber polynomials, arXiv:1912.06652 [math.CO], 2019.
Programs
-
Magma
[Factorial(NthPrime(n)-1) mod NthPrime(n)^2 : n in [1..50]]; // G. C. Greubel, Dec 17 2019
-
Maple
seq(`mod`(factorial(ithprime(n)-1), ithprime(n)^2), n = 1..50); # G. C. Greubel, Dec 17 2019
-
Mathematica
Table[Mod[(Prime[n]-1)!, Prime[n]^2], {n, 50}] (* G. C. Greubel, Dec 17 2019 *)
-
PARI
a(n) = my(p=prime(n)); (p-1)! % p^2; \\ Michel Marcus, Dec 17 2019
-
Sage
[mod(factorial(nth_prime(n)-1), nth_prime(n)^2) for n in (1..50)] # G. C. Greubel, Dec 17 2019
Formula
Extensions
Offset 1 and more terms from Michel Marcus, Dec 17 2019
Comments