{"id":"integer-derangements-count","version":"1.0.0","description":"Compute !n, the number of derangements (permutations with no fixed point) of n items, exactly.","supported_operations":["integer derangements count","subfactorial","permutations with no fixed points"],"unsupported_operations":["negative index","partial derangements","floating-point approximation"],"semantics":["n is a JSON integer from 0 to 100000.","!0 is 1 (the empty permutation) and !1 is 0 (a single item cannot avoid its own position).","The sequence is computed via the exact integer recurrence !n = (n-1) * (!(n-1) + !(n-2)), never floating point.","Requests whose exact result would exceed 1000 digits are rejected rather than truncated."],"limits":{"max_n":100000,"max_digits":1000},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["n"],"properties":{"n":{"type":"integer","minimum":0,"maximum":100000}}},"output_schema":{"type":"object","additionalProperties":false,"required":["value"],"properties":{"value":{"type":"string"}}},"examples":[{"input":{"n":4},"output":{"value":"9"}}],"execute_url":"/v1/tools/integer-derangements-count/versions/1.0.0/execute"}