{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Summary\n\nThe extended Euclidean algorithm computes the [[greatest common divisor|02WF878BH1]] $d$ of two integers $a$ and $b$, and also integers $x$ and $y$ such that $a x + b y = d$.\nIt does the steps of the [[Euclidean algorithm|0TRNT4X7J0]].\nAt each step, it writes the new remainder as an integer combination of $a$ and $b$.\n\n## Remarks\n\nThe coefficients $x$ and $y$ prove [[Bézout's identity|0DQVHMYAGA]] for $a$ and $b$.\nWhen $\\gcd(a, n) = 1$, the coefficient $x$ of $a$ is a [[modular multiplicative inverse|00GXTQMY8Z]] of $a$ modulo $n$.\n\n## Explanations\n\n### L1 human\n\nFor $a = 48$ and $b = 18$, the Euclidean algorithm gives $12 = 48 - 2 \\cdot 18$ and $6 = 18 - 1 \\cdot 12$.\nPut the first equation into the second: $6 = 18 - (48 - 2 \\cdot 18) = 3 \\cdot 18 - 1 \\cdot 48$.\nSo $x = -1$ and $y = 3$ give $48 x + 18 y = 6$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "concept",
    "msc": [
      "11A05"
    ],
    "name": "Extended Euclidean algorithm",
    "same_as": {
      "wikidata": "Q1362750",
      "wikipedia": "Extended Euclidean algorithm"
    },
    "sources": [
      {
        "locator": "Description",
        "url": "https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm"
      }
    ],
    "tag": "0964YQFSA8"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0964YQFSA8/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/0964YQFSA8.md",
  "msc": [
    "11A05"
  ],
  "name": "Extended Euclidean algorithm",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/096/0964YQFSA8.md",
  "status": null,
  "tag": "0964YQFSA8",
  "uri": "m2://0964YQFSA8",
  "url": "https://math2.tamnd.com/wiki/extended-euclidean-algorithm/",
  "writing": {
    "tag": "0964YQFSA8",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
