{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $n$ be an integer with $n \u003e 1$.\nIf $(n - 1)! \\equiv -1 \\pmod n$, then $n$ is a [[prime number|0SN0MAEKYX]].\n\n## Remarks\n\nWith [[Wilson's theorem|03KGGKTB2E]], this gives: an integer $n \u003e 1$ is prime if and only if $(n - 1)! \\equiv -1 \\pmod n$.\nThe proof: if $n = a b$ with $1 \u003c a \u003c n$, then $a$ divides $(n - 1)!$. A congruence $(n - 1)! \\equiv -1 \\pmod n$ would give $a \\mid 1$, which is false.\nIn fact $(n - 1)! \\equiv 0 \\pmod n$ for each composite $n \u003e 4$, and $3! \\equiv 2 \\pmod 4$.\nThis primality test is not practical, because $(n - 1)!$ needs about $n$ multiplications.\n\n## Explanations\n\n### L1 human\n\nFor a composite number $n$, a factor of $n$ appears in the product $1 \\cdot 2 \\cdots (n - 1)$.\nSo the product cannot leave the remainder $n - 1$. For example, $5! = 120 \\equiv 0 \\pmod 6$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "11A51"
    ],
    "name": "Converse of Wilson's theorem",
    "role": "proposition",
    "sources": [
      {
        "locator": "Composite modulus",
        "url": "https://en.wikipedia.org/wiki/Wilson%27s_theorem"
      }
    ],
    "tag": "06WRV8HFDY",
    "uses": [
      "03KGGKTB2E",
      "0SN0MAEKYX"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/06WRV8HFDY/",
  "links": [
    {
      "field": "uses",
      "target": "03KGGKTB2E"
    },
    {
      "field": "uses",
      "target": "0SN0MAEKYX"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/06WRV8HFDY.md",
  "msc": [
    "11A51"
  ],
  "name": "Converse of Wilson's theorem",
  "prov": null,
  "role": "proposition",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/06W/06WRV8HFDY.md",
  "status": null,
  "tag": "06WRV8HFDY",
  "uri": "m2://06WRV8HFDY",
  "url": "https://math2.tamnd.com/wiki/converse-of-wilsons-theorem/",
  "writing": {
    "tag": "06WRV8HFDY",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
