A267133 a(n) = (1/n)(2/n)(3/n)...((n-1)/n) where (k/n) is the Kronecker symbol, n >= 1.
1, 1, -1, 0, 1, 0, -1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 1, 0, 0
Offset: 1
Examples
a(3) = (1/3)(2/3) = (1)(-1) = -1.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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
Formula
Extensions
"Jacobi symbol" in Name changed to "Kronecker symbol" by Jianing Song, Dec 30 2018