OFFSET
1,1
COMMENTS
Residue of (prime(n)-1)!+1 modulo prime(n)+2.
EXAMPLE
prime(3)=5, 4! + 1 = 25 gives residue 4 when divided by prime(3) + 2 = 7.
MATHEMATICA
Table[Mod[(Prime[k] - 1)! + 1, Prime[k] + 2], {k, 1, 200}]
PROG
(Sage) [Mod(factorial(p-1)+1, p+2) for p in primes(500)] # Bruno Berselli, Apr 10 2015
(Magma) [(Factorial(p-1)+1) mod (p+2): p in PrimesUpTo(500)]; // Bruno Berselli, Apr 10 2015
(PARI) a(n) = ((prime(n)-1)! + 1) % (prime(n) + 2); \\ Michel Marcus, May 28 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved