{
  "aliases": [
    "fermat-euler-theorem",
    "euler-totient-theorem"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "0HM584C465"
    },
    {
      "field": "uses",
      "target": "0SBRX5CZ5R"
    }
  ],
  "body": "\n## Statement\n\nLet $n$ be a positive integer and let $a$ be an integer [[coprime|0GFKP8F8AG]] to $n$.\nThen $a^{\\varphi(n)} \\equiv 1 \\pmod n$, where $\\varphi$ is [[Euler's totient function|0VV04M41AN]].\n\n## Remarks\n\nWhen $n = p$ is prime, $\\varphi(p) = p - 1$, and the result is [[Fermat's little theorem|0M25PRN3WQ]].\nA proof uses [[Lagrange's theorem|3C53TD]]: the group $(\\mathbb{Z}/n\\mathbb{Z})^\\times$ has order $\\varphi(n)$, by the [[number of invertible residues modulo n|06RJWZCG95]].\nThe result lets us reduce exponents. If $\\gcd(a, n) = 1$ and $k \\equiv l \\pmod{\\varphi(n)}$, then $a^k \\equiv a^l \\pmod n$.\nFor example, $\\varphi(10) = 4$, so $7^{4} \\equiv 1 \\pmod{10}$, and the last digit of $7^{222}$ is the last digit of $7^2 = 49$, that is, $9$.\n\n## History\n\nEuler proved the theorem in 1763.\n\n## Explanations\n\n### L1 human\n\nPowers of $a$ modulo $n$ repeat in a cycle, and the cycle comes back to $1$.\nEuler's theorem gives one exponent that always brings $a$ back to $1$, namely $\\varphi(n)$.\nFor $n = 12$ and $a = 5$: $\\varphi(12) = 4$ and $5^4 = 625 = 52 \\cdot 12 + 1$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "fermat-euler-theorem",
      "euler-totient-theorem"
    ],
    "kind": "statement",
    "msc": [
      "11A07"
    ],
    "name": "Euler's theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q193910",
      "wikipedia": "Euler's theorem"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Euler%27s_theorem"
      }
    ],
    "tag": "0VC4DVE7DQ",
    "uses": [
      "0VV04M41AN",
      "0TPW25CBN6",
      "0GFKP8F8AG"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/0VC4DVE7DQ/",
  "links": [
    {
      "field": "uses",
      "target": "0VV04M41AN"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    },
    {
      "field": "uses",
      "target": "0GFKP8F8AG"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0VC4DVE7DQ.md",
  "msc": [
    "11A07"
  ],
  "name": "Euler's theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0VC/0VC4DVE7DQ.md",
  "status": null,
  "tag": "0VC4DVE7DQ",
  "uri": "m2://0VC4DVE7DQ",
  "url": "https://math2.tamnd.com/wiki/eulers-theorem/",
  "writing": {
    "tag": "0VC4DVE7DQ",
    "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
      }
    ]
  }
}
