OFFSET
1,2
COMMENTS
a(n) == (-1)^((p-1)/2) (mod p), if p = prime(n) is odd.
a(n)*A163366(n) == -1 (mod prime(n)), by Wilson's theorem.
REFERENCES
Carl-Erik Froeberg, On sums and products of quadratic residues, BIT, Nord. Tidskr. Inf.-behandl. 11 (1971) 389-398.
LINKS
FORMULA
a(n) = A177861(n) modulo prime(n).
EXAMPLE
a(1) = 1 = the empty product, because there are no quadratic nonresidues of prime(1) = 2.
a(4) = 6 because the quadratic nonresidues of prime(4) = 7 are 3, 5, and 6, and 3*5*6 = 90 == 6 (mod 7).
MATHEMATICA
Table[Mod[ Apply[Times, Flatten[Position[ Table[JacobiSymbol[i, Prime[n]], {i, 1, Prime[n] - 1}], -1]]], Prime[n]], {n, 1, 80}]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Sondow, May 14 2010
STATUS
approved