cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A212158 a(n) = ((prime(n) - 1)/2)!, n >= 2.

Original entry on oeis.org

1, 2, 6, 120, 720, 40320, 362880, 39916800, 87178291200, 1307674368000, 6402373705728000, 2432902008176640000, 51090942171709440000, 25852016738884976640000, 403291461126605635584000000, 8841761993739701954543616000000
Offset: 2

Views

Author

Wolfdieter Lang, May 08 2012

Keywords

Comments

a(n)^2 == (-1)^((prime(n) + 1)/2) (mod prime(n)).
Use product(p-j,j=1..(p-1)/2) == (-1)^((p-1)/2)*a(n) (mod p) for p=prime(n), n>=2, hence a(n)*(-1)^((p-1)/2)*a(n) == (p-1)! (mod p), then apply Wilson's theorem. That is, a(n)^2 == -1 (mod prime(n)) for primes of the form 4*k+1 (see A002144) and +1 for primes of the form 4*k+3 (see A002145). See the link with a blog by W. Holsztyński.
See A004055 for a(n) (mod prime(n)), n>=2.
See A212159 for a(n)^2 (mod prime(n)), n>=2.

Examples

			a(4) = ((7-1)/2)! = 3! = 6.
a(4)^2 = 36 == +1 (mod 7), because (7 + 1)/2 = 4, and 4 is even.
a(6) = ((13-1)/2)! = 6! = 720.
a(6)^2 = 518400 == -1 (mod 13) = 12 (mod 13) because (13+1)/2 = 7, and 7 is odd.
		

Programs

  • Mathematica
    ((Prime[Range[2,20]]-1)/2)! (* Harvey P. Dale, Jan 24 2021 *)

Formula

a(n) = ((prime(n) - 1)/2)!, n>=2, with prime(n) = A000040(n).
a(n) = A005097(n-1)!, n>=2.

A265643 a(n) = +-1 == ((p - 1)/2)! (mod p), where p is the n-th prime number == 3 (mod 4).

Original entry on oeis.org

1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1
Offset: 1

Views

Author

Carlo Sanna, Dec 11 2015

Keywords

Comments

By Wilson's theorem, ((p - 1)/2)!^2 == (-1)^((p + 1)/2) (mod p) for each prime number p. Hence, if p == 3 (mod 4), then ((p - 1)/2)! == +-1 (mod p).
Michele Elia proved that a(n) = (-1)^((1 + h(-p)) / 2) for n > 1, where p is the n-th prime number == 3 (mod 4), and h(-p) is the class number of the quadratic field Q(sqrt(-p)).
Mordell (1961) proved the same result 52 years earlier in a 2-page note in the Monthly. - Jonathan Sondow, Apr 09 2017

Examples

			The second prime number == 3 (mod 4) is 7. Since ((7 - 1)/2)! = 3! = 6 == -1 (mod 7), it follows that a(2) = -1.
		

Crossrefs

Programs

  • Maple
    map(p -> if isprime(p) then mods(((p-1)/2)!, p) fi, [seq(i,i=3..10000, 4)]); # Robert Israel, Dec 11 2015
  • Mathematica
    Function[p, Mod[((p-1)/2)!, p, -1]] /@ Select[Range[3, 2003, 4], PrimeQ] (* Jean-François Alcover, Feb 27 2016 *)
Showing 1-2 of 2 results.