{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "0SZCSYHW60"
    }
  ],
  "body": "\n## Summary\n\nA primality test is an algorithm that decides whether a given natural number is [[prime|0SN0MAEKYX]].\nUnlike factorization, it does not need to find the factors of a composite number.\n\n## Remarks\n\nThe simplest test is [[trial division|0Z962ECCXR]] by the primes up to $\\sqrt{n}$, but it is slow for large $n$.\nProbabilistic tests, such as the [[Fermat test|0N5ZSZMYH6]] and the [[Miller–Rabin test|0SZCSYHW60]], are fast but can accept a composite number with a small probability.\nIn 2002, Agrawal, Kayal and Saxena gave the first deterministic test that runs in polynomial time without an unproven hypothesis.\n\n## Explanations\n\n### L1 human\n\nA primality test answers the question \"is $n$ prime?\".\nFor numbers with hundreds of digits, this is much easier than finding the factors of $n$.\n",
  "commit": "545acf83a9b75c8ddc375ef8b23d2ae101a4d7e4",
  "front": {
    "kind": "concept",
    "msc": [
      "11Y11"
    ],
    "name": "Primality test",
    "same_as": {
      "wikidata": "Q829546",
      "wikipedia": "Primality test"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Primality_test"
      }
    ],
    "tag": "0EGJZHZ02C",
    "uses": [
      "0SN0MAEKYX"
    ]
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0EGJZHZ02C/",
  "links": [
    {
      "field": "uses",
      "target": "0SN0MAEKYX"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0EGJZHZ02C.md",
  "msc": [
    "11Y11"
  ],
  "name": "Primality test",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0EG/0EGJZHZ02C.md",
  "status": null,
  "tag": "0EGJZHZ02C",
  "uri": "m2://0EGJZHZ02C",
  "url": "https://math2.tamnd.com/wiki/primality-test/",
  "writing": {
    "tag": "0EGJZHZ02C",
    "kind": "concept",
    "level": "W1",
    "next": [
      {
        "what": "edge defines in",
        "note": "at least one definition",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of in",
        "note": "at least two examples",
        "have": 0,
        "want": 2
      },
      {
        "what": "edge not_instance_of in",
        "note": "at least one non-example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge specializes both",
        "note": "the more general notions and the special cases",
        "have": 0,
        "want": 1
      }
    ]
  }
}
