{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $n$ be a natural number.\nThen $n = x^2 + y^2 + z^2$ for some integers $x$, $y$ and $z$ if and only if $n \\neq 4^a (8b + 7)$ for all natural numbers $a$ and $b$.\n\n## Remarks\n\nThe \"only if\" part is easy: a square is $0$, $1$ or $4$ modulo $8$, so no sum of three squares is $7$ modulo $8$.\nThe first numbers that are not sums of three squares are $7$, $15$, $23$, $28$ and $31$.\nThe theorem implies [[Lagrange's four-square theorem|0KYYSMEVHH]] in a few lines.\n\n## History\n\nLegendre gave the first proof in 1797 or 1798.\nGauss proved a more general result in 1801.\n\n## Explanations\n\n### L1 human\n\nMost numbers are sums of three squares, for example $6 = 4 + 1 + 1$.\nThe exceptions are $7, 15, 23, \\dots$, the numbers that leave remainder $7$ on division by $8$, and these numbers times powers of $4$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "11E25"
    ],
    "name": "Legendre's three-square theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q15940470",
      "wikipedia": "Legendre's three-square theorem"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Legendre%27s_three-square_theorem"
      },
      {
        "locator": "History",
        "url": "https://en.wikipedia.org/wiki/Legendre%27s_three-square_theorem"
      }
    ],
    "tag": "0B64Q7XNE3"
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/0B64Q7XNE3/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/0B64Q7XNE3.md",
  "msc": [
    "11E25"
  ],
  "name": "Legendre's three-square theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0B6/0B64Q7XNE3.md",
  "status": null,
  "tag": "0B64Q7XNE3",
  "uri": "m2://0B64Q7XNE3",
  "url": "https://math2.tamnd.com/wiki/legendres-three-square-theorem/",
  "writing": {
    "tag": "0B64Q7XNE3",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge uses out",
        "note": "each definition that the statement needs",
        "have": 0,
        "want": 1
      }
    ]
  }
}
