OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(3) = (1/3)(2/3) = (1)(-1) = -1.
MAPLE
f:= proc(n) if not isprime(n) then 0 elif n mod 4 = 3 then -1 else 1 fi end proc:
f(1):= 1:
map(f, [$1..1000]); # Robert Israel, Jan 14 2016
MATHEMATICA
Table[Product[JacobiSymbol[k, n], {k, n - 1}], {n, 75}] (* Michael De Vlieger, Jan 12 2016 *)
PROG
(PARI) a(n) = prod(k=1, n-1, kronecker(k, n)); \\ Michel Marcus, Jan 11 2016
(PARI) a(n)=if(isprime(n), (-1)^(n%4>2), n==1) \\ Charles R Greathouse IV, Jan 14 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Dimitri Papadopoulos, Jan 10 2016
EXTENSIONS
"Jacobi symbol" in Name changed to "Kronecker symbol" by Jianing Song, Dec 30 2018
STATUS
approved