Subfactorial Calculator

Exactderangement!nBigIntrecurrence,(n−1)(!(n−1)+!(n−2)),0≤n≤1000. Explicit bounded resource/branch and actual observations or independently verified parameters; no unproved infinite assertion certified.

Description

A subfactorial counts permutations with no fixed points.

A subfactorial counts permutations with no fixed points.1

This tool uses an exact integer recurrence and returns the derangement count as a decimal string.

When to use Subfactorial Calculator

This tool uses an exact integer recurrence and returns the derangement count as a decimal string.

How to use Subfactorial Calculator and how it works

  1. Prepare n, using the input definitions and matching units below.
  2. Enter the required fields and run Subfactorial Calculator.
  3. Read result.exactSubfactorial using the units, signs and ordering explained below.
  4. Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
Input fieldMeaningValue typeRequirement
actualNInteger index n for the named derangement or nth-prime operation; use its stated branch below.numberRequired; finite; other constraints below

Require n integer 0–1000. Use BigInt with D0=1 and D1=0, then Dn=(n-1)*(D(n-1)+D(n-2)). Return the exact decimal-string count. Subfactorial notation denotes derangements, not factorial division or a rounded n!/e approximation.

D0=1; D1=0; Dn=(n-1)*(D(n-1)+D(n-2))

Apply the input ordering, units and branch conditions stated above.

Output fieldMeaningValue type
resultObject containing the calculated or selected fields below.object
result.exactSubfactorialExact derangement count as a decimal string.string
json
{
  "input": {
    "actualN": 4
  },
  "output": {
    "result": {
      "exactSubfactorial": "9"
    }
  }
}

Limitations and assumptions

The calculation uses the supplied observations and model inputs. It does not collect measurements, select a reference population or coefficient, or establish that the model applies to the actual case. The stated branch conditions and output units remain part of the result.

All fields require explicit values. Unexpected fields, wrong types, nonfinite numbers and sparse arrays are rejected. Alignment, bounds and supported-token rules are explained above; extremely large inputs or nonfinite results can also fail. Input errors differ from successful false comparisons, unavailable-domain flags and empty match lists.

Alternative or Complementary methods

Use Pascal Determinant Calculator for a complementary operation: The leading symmetric Pascal matrix factors into unit triangular matrices, giving determinant one.

Use Hilbert Matrix Entry Calculator for a complementary operation: The Hilbert matrix uses reciprocal sums of one-based row and column indices.

References

  1. Subfactorial Calculator — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies