OFFSET
1,2
COMMENTS
Values 1 correspond to primes listed in A058302. - Max Alekseyev, Oct 24 2023
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..9999 [b-file corrected by N. J. A. Sloane, Oct 04 2010]
MAPLE
a:= n-> (p-> ((p-1)/2)! mod p)(ithprime(n+1)):
seq(a(n), n=1..73); # Alois P. Heinz, Oct 25 2023
MATHEMATICA
Mod[((#-1)/2)!, #]& /@ Prime[Range[2, 100]] (* Jean-François Alcover, Jan 02 2025 *)
PROG
(PARI) lista(n)=forprime(p=3, n, print1(((p-1)/2)! % p, ", ")); \\ Michel Marcus, May 24 2013
(PARI) a(n, p=prime(n+1))=lift(prod(k=2, p\2, k, Mod(1, p))) \\ Charles R Greathouse IV, May 01 2016
(Magma) [Factorial((p-1) div 2) mod p: p in PrimesInInterval(3, 350)]; // Vincenzo Librandi, May 01 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Dec 11 1996
STATUS
approved