cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A112660 a(n) = (p-1)! mod p^2 where p = n-th prime.

Original entry on oeis.org

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

Views

Author

Roger Hui, Dec 28 2005

Keywords

Comments

Related to the Wilson primes A007540, which are primes p such that (p-1)! = -1 mod p^2.

Crossrefs

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

a(n) = A177771(n) mod A001248(n). - Michel Marcus, Dec 17 2019

Extensions

Offset 1 and more terms from Michel Marcus, Dec 17 2019