二次剩余

Quadratic Residue.

If there is an integer 0<x<p0<x<p such that x2≡a(modp)x^2\equiv a\pmod{p}. We call aa a quadratic residue modulo pp. Otherwise (such xx doesn't exist), we call aa a quadratic nonresidue modulo pp.

Note that p∤ap \nmid a to exclude the trivial cases x=0x=0.

The quadratic residue problem requires us to solve the congrence x2≡a(modp)x^2\equiv a\pmod{p}. Essentially it is to find the square root of aa in the sense of modulo pp. Usually, the moduli pp is an odd prime.

Legendre Symbol

The legendre symbol is a number theoretic function (ap)(\frac{a}{p}) which is defined to be equal to ±1\pm 1 depending on whether aa is a quadratic residue modulo pp.

(ap)=(a∣p)={ 0, if  p∣a 1, if a is a quadratic residue modulo p−1, if a is a quadratic nonresidue modulo p (\frac{a}{p})=(a|p)=\begin{cases} \ 0, \ if \ \ p|a \\ \ 1, \ if \ a \ is \ a \ quadratic \ residue \ modulo \ p \\ -1 , \ if \ a \ is \ a \ quadratic \ nonresidue \ modulo \ p \end{cases}

Euler's Criterion

For an odd prime pp and p∤ap \nmid a, the Legendre symbol (ap)≡a(p−1)/2(modp)(\frac{a}{p})\equiv a^{(p-1)/2} \pmod{p}.

For an odd prime pp and p∤ap \nmid a, according to Euler's critetion, we could determine whether aa is a quadratic residue modulo pp by checking whether a(p−1)/2mod  pa^{(p-1)/2}\mod{p} equals to 11 or not.

See the prove here.

Eureka moment!

虽然在本课程中关于二次剩余问题的内容只是浅尝辄止,但我觉得还是非常有必要将其单独拿出来进行介绍,因为这个问题的研究在数论上占有举足轻重的地位。

二次剩余问题本质上是模意义下的开根问题,实际上是 RSA 问题的铺垫:RSA 问题本质上是模意义下的开 ee 次根问题。因此,当 e=2e=2 时,RSA 问题与二次剩余问题等价。