{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $n$ be a positive integer and let $F_n = 2^{2^n} + 1$ be the [[Fermat number|0R03B54V4Z]].\nThen $F_n$ is prime if and only if\n$$3^{(F_n - 1)/2} \\equiv -1 \\pmod{F_n}.$$\n\n## Remarks\n\nFor example, $F_1 = 5$ and $3^2 = 9 \\equiv -1 \\pmod 5$.\nThe power can be computed by $2^n - 1$ squarings with [[modular exponentiation|04DR5PM25N]].\nThe \"only if\" part follows from [[Euler's criterion|0M7DEDKSYB]] and quadratic reciprocity, since $3$ is a nonresidue modulo $F_n$.\n\n## History\n\nThe test is named after Théophile Pépin.\n\n## Explanations\n\n### L1 human\n\nPépin's test decides whether a Fermat number is prime with one large modular power.\nThe Fermat numbers grow so fast that the test is practical only for small $n$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "11Y11"
    ],
    "name": "Pépin's test",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q1779493",
      "wikipedia": "Pépin's test"
    },
    "sources": [
      {
        "locator": "Description of the test",
        "url": "https://en.wikipedia.org/wiki/P%C3%A9pin%27s_test"
      }
    ],
    "tag": "07HXA8KV6F",
    "uses": [
      "0R03B54V4Z",
      "0TPW25CBN6"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/07HXA8KV6F/",
  "links": [
    {
      "field": "uses",
      "target": "0R03B54V4Z"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/07HXA8KV6F.md",
  "msc": [
    "11Y11"
  ],
  "name": "Pépin's test",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/07H/07HXA8KV6F.md",
  "status": null,
  "tag": "07HXA8KV6F",
  "uri": "m2://07HXA8KV6F",
  "url": "https://math2.tamnd.com/wiki/pepins-test/",
  "writing": {
    "tag": "07HXA8KV6F",
    "kind": "statement",
    "level": "W1",
    "next": [
      {
        "what": "edge about out",
        "note": "the concepts that the statement is about",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge proves in",
        "note": "at least one proof node",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of or illustrates in",
        "note": "one example that shows the statement at work",
        "have": 0,
        "want": 1
      },
      {
        "what": "explanation L2",
        "have": 0,
        "want": 1
      }
    ]
  }
}
