OFFSET
1,3
COMMENTS
a(n) == (-1)^((p+1)/2) (mod p), if p = prime(n) is odd.
REFERENCES
Carl-Erik Froeberg, On sums and products of quadratic residues, BIT, Nord. Tidskr. Inf.-behandl. 11 (1971) 389-398.
LINKS
FORMULA
a(n) = (p-1)!/A177861(n), where p = prime(n).
EXAMPLE
The quadratic residues of prime(4) = 7 are 1, 2, and 4, so a(4) = 1*2*4 = 8.
MATHEMATICA
Table[ Apply[Times, Flatten[Position[ Table[JacobiSymbol[i, Prime[n]], {i, 1, Prime[n] - 1}], 1]]], {n, 1, 16}]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Sondow, May 14 2010
STATUS
approved