{
  "aliases": [
    "euler-phi-function",
    "totient-function",
    "phi-function"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "06RJWZCG95"
    },
    {
      "field": "uses",
      "target": "09JXE6XMCC"
    },
    {
      "field": "uses",
      "target": "0AVY8HKBGD"
    },
    {
      "field": "uses",
      "target": "0FSJA9M43W"
    },
    {
      "field": "uses",
      "target": "0HM584C465"
    },
    {
      "field": "uses",
      "target": "0HY1MXMEN9"
    },
    {
      "field": "uses",
      "target": "0KM2CJ80G7"
    },
    {
      "field": "uses",
      "target": "0VC4DVE7DQ"
    }
  ],
  "body": "\n## Definition\n\nLet $n$ be a positive integer.\nEuler's totient function $\\varphi(n)$ is the number of integers $k$ with $1 \\le k \\le n$ such that $k$ and $n$ are [[coprime|0GFKP8F8AG]].\n\n## Remarks\n\nFor example, $\\varphi(1) = 1$, $\\varphi(9) = 6$ and $\\varphi(12) = 4$. The integers coprime to $12$ in $\\{1, \\dots, 12\\}$ are $1, 5, 7, 11$.\nThe number $\\varphi(n)$ is the number of elements of a [[reduced residue system|0J0QEN1DZR]] modulo $n$.\nIf $n = p_1^{e_1} \\cdots p_r^{e_r}$ with distinct primes $p_i$, then $\\varphi(n) = n \\prod_{i=1}^{r} \\left(1 - \\frac{1}{p_i}\\right)$.\nThe Lean library Mathlib sets $\\varphi(0) = 0$.\n\n## Explanations\n\n### L1 human\n\nCount the numbers from $1$ to $n$ that have no common factor with $n$.\nFor $n = 10$, these are $1, 3, 7, 9$, so $\\varphi(10) = 4$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "euler-phi-function",
      "totient-function",
      "phi-function"
    ],
    "defines": "0DAMHCT17R",
    "kind": "definition",
    "msc": [
      "11A25"
    ],
    "name": "Euler's totient function",
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Euler%27s_totient_function"
      }
    ],
    "tag": "0VV04M41AN",
    "uses": [
      "0GFKP8F8AG"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/0VV04M41AN/",
  "links": [
    {
      "field": "defines",
      "target": "0DAMHCT17R"
    },
    {
      "field": "uses",
      "target": "0GFKP8F8AG"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0VV04M41AN.md",
  "msc": [
    "11A25"
  ],
  "name": "Euler's totient function",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0VV/0VV04M41AN.md",
  "status": null,
  "tag": "0VV04M41AN",
  "uri": "m2://0VV04M41AN",
  "url": "https://math2.tamnd.com/wiki/eulers-totient-function-definition/",
  "writing": {
    "tag": "0VV04M41AN",
    "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
      }
    ]
  }
}
