Legendre Symbol

Author

Eric W. Weisstein
October 19, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/LegendreSymbol.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/LegendreSymbol.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

(JacobiSymbol[-1, p])==(((-1))^((p-1)/2))

FunctionExpand[JacobiSymbol[-1,p],p∈Primes&&p>2]

Subtract@@@({(-1)^((#-1)/2),JacobiSymbol[-1,#]}&/@Table[Prime[n],{n,2,100}])//Union

(JacobiSymbol[2, p])==(((-1))^((1/8) ((p^2)-1)))

FunctionExpand[JacobiSymbol[2,p],p∈Primes&&p>2]

Subtract@@@({(-1)^((#^2-1)/8),JacobiSymbol[2,#]}&/@Table[Prime[n],{n,2,100}])//Union

(((-3)/p))

{Switch[Mod[#,6],1,1,5,-1,_,0],JacobiSymbol[-3,#]}&/@Table[Prime[n],{n,2,50}]

And@@Equal@@@%

((5/p))

{Switch[Mod[#,10],1|9,1,3|7,-1,_,0],JacobiSymbol[5,#]}&/@Table[Prime[n],{n,2,50}]

And@@Equal@@@%