login
A049563
a(n) = ((prime(n)-1)! + 1) mod (prime(n) + 2).
0
2, 3, 4, 1, 7, 1, 10, 1, 1, 16, 1, 1, 22, 1, 1, 1, 31, 1, 1, 37, 1, 1, 1, 1, 1, 52, 1, 55, 1, 1, 1, 1, 70, 1, 76, 1, 1, 1, 1, 1, 91, 1, 97, 1, 100, 1, 1, 1, 115, 1, 1, 121, 1, 1, 1, 1, 136, 1, 1, 142, 1, 1, 1, 157, 1, 1, 1, 1, 175, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 211, 1, 217, 1, 1, 1, 1, 1
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
Sequence in context: A255690 A030104 A255590 * A198495 A084453 A097104
KEYWORD
nonn
AUTHOR
STATUS
approved