Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 Sep 08 2022 08:44:58
%S 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,
%T 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,
%U 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
%N a(n) = ((prime(n)-1)! + 1) mod (prime(n) + 2).
%C Residue of (prime(n)-1)!+1 modulo prime(n)+2.
%e prime(3)=5, 4! + 1 = 25 gives residue 4 when divided by prime(3) + 2 = 7.
%t Table[Mod[(Prime[k] - 1)! + 1, Prime[k] + 2], {k, 1, 200}]
%o (Sage) [Mod(factorial(p-1)+1,p+2) for p in primes(500)] # _Bruno Berselli_, Apr 10 2015
%o (Magma) [(Factorial(p-1)+1) mod (p+2): p in PrimesUpTo(500)]; // _Bruno Berselli_, Apr 10 2015
%o (PARI) a(n) = ((prime(n)-1)! + 1) % (prime(n) + 2); \\ _Michel Marcus_, May 28 2018
%K nonn
%O 1,1
%A _Labos Elemer_