OFFSET
1,3
COMMENTS
Remove the '1's from the sequence to get A152680.
Product modulo p of the quadratic residues of p, where p = prime(n). [Jonathan Sondow, May 14 2010]
REFERENCES
Carl-Erik Froeberg, On sums and products of quadratic residues, BIT, Nord. Tidskr. Inf.-behandl. 11 (1971) 389-398. [Jonathan Sondow, May 14 2010]
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Rahul Gupta, Algorithmic Number Theory, Section 24.5 [Jonathan Sondow, May 14 2010]
FORMULA
a(n)*A177863(n) == -1 (mod prime(n)), by Wilson's theorem. - Jonathan Sondow, May 14 2010
a(n) = A177860(n) modulo prime(n). - Jonathan Sondow, May 14 2010
EXAMPLE
a(4) = 1 because the quadratic residues of prime(4) = 7 are 1, 2, and 4, and 1*2*4 = 8 == 1 (mod 7). - Jonathan Sondow, May 14 2010
MAPLE
seq((-1)^iquo(ithprime(i)+2, 2) mod ithprime(i), i=1..113);
MATHEMATICA
Table[Mod[ Apply[Times, Flatten[Position[ Table[JacobiSymbol[i, Prime[n]], {i, 1, Prime[n] - 1}], 1]]], Prime[n]], {n, 1, 80}] (* Jonathan Sondow, May 14 2010 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jul 25 2009
STATUS
approved