login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A112660 a(n) = (p-1)! mod p^2 where p = n-th prime. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Related to the Wilson primes A007540, which are primes p such that (p-1)! = -1 mod p^2.
LINKS
Claire Levaillant, Wilson's theorem modulo p^2 derived from Faulhaber polynomials, arXiv:1912.06652 [math.CO], 2019.
FORMULA
a(n) = A177771(n) mod A001248(n). - Michel Marcus, 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 *)
PROG
(PARI) a(n) = my(p=prime(n)); (p-1)! % p^2; \\ Michel Marcus, Dec 17 2019
(Magma) [Factorial(NthPrime(n)-1) mod NthPrime(n)^2 : n in [1..50]]; // G. C. Greubel, 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
CROSSREFS
Sequence in context: A022374 A139334 A212759 * A330526 A280648 A339403
KEYWORD
nonn
AUTHOR
Roger Hui, Dec 28 2005
EXTENSIONS
Offset 1 and more terms from Michel Marcus, Dec 17 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)