{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $x$ be a real number.\nThe [[continued fraction expansion|0SJ7Z6VKWK]] of $x$ is finite if and only if $x$ is rational.\n\n## Remarks\n\nIf $x = a/b$ with $b \u003e 0$, the expansion follows the [[Euclidean algorithm|0TRNT4X7J0]] on $a$ and $b$. So it stops after finitely many steps.\nConversely, a finite simple continued fraction is a rational number.\nFor example, $\\frac{43}{19}$: $43 = 2 \\cdot 19 + 5$, $19 = 3 \\cdot 5 + 4$, $5 = 1 \\cdot 4 + 1$, $4 = 4 \\cdot 1$. So $\\frac{43}{19} = [2; 3, 1, 4]$.\nA rational number has exactly two finite expansions, since $[a_0; \\dots, a_n] = [a_0; \\dots, a_n - 1, 1]$ when $a_n \u003e 1$.\n\n## Explanations\n\n### L1 human\n\nFor a fraction, the continued fraction algorithm is the Euclidean algorithm in another form.\nThe remainders get smaller, so the process must end.\nAn irrational number gives an infinite continued fraction.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "11A55"
    ],
    "name": "The continued fraction of a rational number terminates",
    "role": "theorem",
    "sources": [
      {
        "locator": "Finite continued fractions",
        "url": "https://en.wikipedia.org/wiki/Simple_continued_fraction"
      }
    ],
    "tag": "0PMY0YQYXX",
    "uses": [
      "0SJ7Z6VKWK",
      "0TRNT4X7J0"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/0PMY0YQYXX/",
  "links": [
    {
      "field": "uses",
      "target": "0SJ7Z6VKWK"
    },
    {
      "field": "uses",
      "target": "0TRNT4X7J0"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0PMY0YQYXX.md",
  "msc": [
    "11A55"
  ],
  "name": "The continued fraction of a rational number terminates",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0PM/0PMY0YQYXX.md",
  "status": null,
  "tag": "0PMY0YQYXX",
  "uri": "m2://0PMY0YQYXX",
  "url": "https://math2.tamnd.com/wiki/the-continued-fraction-of-a-rational-number-terminates/",
  "writing": {
    "tag": "0PMY0YQYXX",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
