# 二次剩余

## **定义**

$$m$$为正整数，若$$x^2\equiv a\left(\mod m\right),\left(a,m\right)=1$$有解，则$$a$$为$$m$$的二次剩余，否则为二次非剩余

## **欧拉判别条件**

&#x20;$$p$$为奇素数，$$\left(a,p\right)=1$$

* $$a$$是模$$p$$的平方剩余$$\Longleftrightarrow a^{\frac{p-1}{2}}\equiv1\left(\mod p\right)$$
* $$a$$是模$$p$$的非平方剩余$$\Longleftrightarrow a^{\frac{p-1}{2}}\equiv-1\left(\mod p\right)$$

**推论:**&#x20;

* $$p$$为奇素数，$$\left(a\_1,p\right)=1,\left(a\_2,p\right)=1$$，则$$a\_1\cdot a\_2$$为模$$p$$的平方非剩余$$\Longleftrightarrow a\_1,a\_2$$同为模$$p$$的平方剩余或平方非剩余
* 平方剩余与平方非剩余数量相等


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chenyangwang.gitbook.io/mathematical-base-for-information-safety/er-ci-tong-yu-shi-he-ping-fang-sheng-yu/er-ci-sheng-yu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
