A004055 ((p-1)/2)! mod p for odd primes p.
1, 2, 6, 10, 5, 13, 18, 1, 12, 1, 31, 9, 42, 46, 23, 1, 11, 66, 1, 27, 78, 1, 34, 22, 91, 102, 1, 33, 15, 126, 130, 37, 1, 44, 1, 129, 162, 1, 80, 178, 162, 190, 81, 183, 198, 1, 1, 226, 122, 144, 1, 64, 1, 16, 262, 187, 1, 217, 53, 1, 138, 1, 1, 288, 114, 1, 189
Offset: 1
Keywords
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]
Programs
-
Magma
[Factorial((p-1) div 2) mod p: p in PrimesInInterval(3,350)]; // Vincenzo Librandi, May 01 2016
-
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 *)
-
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
Comments