{
  "aliases": [
    "quadratic-nonresidue"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "01J8AMV9RS"
    }
  ],
  "body": "\n## Definition\n\nLet $n$ be a positive integer and let $q$ be an integer.\nThen $q$ is a quadratic residue modulo $n$ if there is an integer $x$ with $x^2 \\equiv q \\pmod n$.\nOtherwise $q$ is a quadratic nonresidue modulo $n$.\n\n## Remarks\n\nMany texts also require $\\gcd(q, n) = 1$, and so they do not count $0$ as a quadratic residue.\nModulo $7$, the squares of $1, \\dots, 6$ are $1, 4, 2, 2, 4, 1$. So the nonzero quadratic residues modulo $7$ are $1$, $2$ and $4$.\nModulo an odd prime $p$, exactly $(p - 1)/2$ of the classes $1, \\dots, p - 1$ are quadratic residues.\nThe product of two quadratic residues is a quadratic residue.\n\n## Explanations\n\n### L1 human\n\nA quadratic residue modulo $n$ is a number that is a perfect square in the arithmetic modulo $n$.\nFor example, $2$ is not a square in the integers, but $3^2 = 9 \\equiv 2 \\pmod 7$. So $2$ is a quadratic residue modulo $7$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "quadratic-nonresidue"
    ],
    "defines": "0DKCECSYCF",
    "kind": "definition",
    "msc": [
      "11A15"
    ],
    "name": "Quadratic residue",
    "sources": [
      {
        "locator": "History, conventions, and elementary facts",
        "url": "https://en.wikipedia.org/wiki/Quadratic_residue"
      }
    ],
    "tag": "0SQDB87Z3T",
    "uses": [
      "0TPW25CBN6"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/0SQDB87Z3T/",
  "links": [
    {
      "field": "defines",
      "target": "0DKCECSYCF"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0SQDB87Z3T.md",
  "msc": [
    "11A15"
  ],
  "name": "Quadratic residue",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0SQ/0SQDB87Z3T.md",
  "status": null,
  "tag": "0SQDB87Z3T",
  "uri": "m2://0SQDB87Z3T",
  "url": "https://math2.tamnd.com/wiki/quadratic-residue-definition/",
  "writing": {
    "tag": "0SQDB87Z3T",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
