{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\n1. Let $p$ be a [[prime number|0SN0MAEKYX]] and let $k$ be a positive integer. By definition, [[Euler's totient function|0VV04M41AN]] $\\varphi(p^k)$ is the number of integers $x$ with $1 \\le x \\le p^k$ that are [[coprime|0GFKP8F8AG]] to $p^k$.\n2. We show that an integer $x$ is coprime to $p^k$ if and only if $p$ does not [[divide|096PW7Q014]] $x$.\n3. Assume $p \\mid x$. Since $k \\ge 1$, $p$ also divides $p^k$. So $p$ is a common divisor, and $\\gcd(x, p^k) \\ge p \u003e 1$.\n4. Assume $p \\nmid x$, and let $d = \\gcd(x, p^k)$ be the [[greatest common divisor|02WF878BH1]]. Since $p^k \\ne 0$, $d$ is positive. Suppose that $d \u003e 1$.\n5. By the [[existence of a prime divisor|0SPBEDVNW1]], there is a prime $q$ with $q \\mid d$. Then $q$ divides $p^k = p \\cdot p \\cdots p$.\n6. By [[Euclid's lemma|051VYKA1EX]], applied to the $k$ factors in turn, $q$ divides $p$. Since $q \u003e 1$ and $p$ is prime, $q = p$.\n7. Then $p = q$ divides $d$, and $d$ divides $x$, so $p \\mid x$. This contradicts step 4. So $d = 1$.\n8. By steps 3 and 7, the integers in $\\{ 1, \\dots, p^k \\}$ that are not coprime to $p^k$ are exactly the multiples of $p$ in this set.\n9. These multiples are $p j$ with $1 \\le j \\le p^{k-1}$, since $1 \\le p j \\le p^k$ is equivalent to $1 \\le j \\le p^{k-1}$ for an integer $j$. So there are $p^{k-1}$ of them.\n10. Hence $\\varphi(p^k) = p^k - p^{k-1} = p^{k-1} (p - 1)$.\n\n## Idea\n\nThe only prime factor of $p^k$ is $p$, so a number shares a factor with $p^k$ exactly when $p$ divides it. Among $1, \\dots, p^k$, every $p$-th number is a multiple of $p$, so we remove $p^{k-1}$ of them.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "methods": [
      "0NTF6DMVAP"
    ],
    "msc": [
      "11A25"
    ],
    "name": "Proof of the formula for the totient of a prime power",
    "proves": "0AVY8HKBGD",
    "sources": [
      {
        "locator": "Value of phi for a prime power argument",
        "url": "https://en.wikipedia.org/wiki/Euler%27s_totient_function"
      }
    ],
    "tag": "VCN0MCW84M",
    "uses": [
      "0VV04M41AN",
      "0SN0MAEKYX",
      "02WF878BH1",
      "0GFKP8F8AG",
      "096PW7Q014",
      "0SPBEDVNW1",
      "051VYKA1EX"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/VCN0MCW84M/",
  "links": [
    {
      "field": "proves",
      "target": "0AVY8HKBGD"
    },
    {
      "field": "uses",
      "target": "0VV04M41AN"
    },
    {
      "field": "uses",
      "target": "0SN0MAEKYX"
    },
    {
      "field": "uses",
      "target": "02WF878BH1"
    },
    {
      "field": "uses",
      "target": "0GFKP8F8AG"
    },
    {
      "field": "uses",
      "target": "096PW7Q014"
    },
    {
      "field": "uses",
      "target": "0SPBEDVNW1"
    },
    {
      "field": "uses",
      "target": "051VYKA1EX"
    },
    {
      "field": "methods",
      "target": "0NTF6DMVAP"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/VCN0MCW84M.md",
  "msc": [
    "11A25"
  ],
  "name": "Proof of the formula for the totient of a prime power",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/VCN/VCN0MCW84M.md",
  "status": null,
  "tag": "VCN0MCW84M",
  "uri": "m2://VCN0MCW84M",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-formula-for-the-totient-of-a-prime-power/",
  "writing": {
    "tag": "VCN0MCW84M",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
