{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "03RSJXF728"
    },
    {
      "field": "uses",
      "target": "045ENVCCZV"
    },
    {
      "field": "uses",
      "target": "0QRRYXG7V7"
    }
  ],
  "body": "\n## Definition\n\nThe derangement numbers $D_n$, for natural numbers $n$, are defined by the recursion\n$$D_0 = 1, \\qquad D_1 = 0, \\qquad D_{n+2} = (n + 1)\\,(D_n + D_{n+1}).$$\n\n## Remarks\n\nThe first values, for $n = 0, 1, \\dots, 6$, are $1, 0, 1, 2, 9, 44, 265$.\nThe value $D_n$ is the number of [[derangements|0TH61JR04G]] of an $n$-element set. The node [[the derangement numbers count derangements|045ENVCCZV]] states this.\nAnother notation is $!n$, the subfactorial of $n$.\n\n## Explanations\n\n### L1 human\n\nThe derangement numbers start $1, 0, 1, 2, 9, 44$.\nEach new number comes from the two before it: $D_4 = 3 \\cdot (D_2 + D_3) = 3 \\cdot 3 = 9$.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "defines": "05WR29H2KH",
    "kind": "definition",
    "msc": [
      "05A05"
    ],
    "name": "Number of derangements",
    "sources": [
      {
        "locator": "Counting derangements",
        "url": "https://en.wikipedia.org/wiki/Derangement"
      }
    ],
    "tag": "03WY4HHMT1"
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/03WY4HHMT1/",
  "links": [
    {
      "field": "defines",
      "target": "05WR29H2KH"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/03WY4HHMT1.md",
  "msc": [
    "05A05"
  ],
  "name": "Number of derangements",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/03W/03WY4HHMT1.md",
  "status": null,
  "tag": "03WY4HHMT1",
  "uri": "m2://03WY4HHMT1",
  "url": "https://math2.tamnd.com/wiki/number-of-derangements-definition/",
  "writing": {
    "tag": "03WY4HHMT1",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
