Facts about factorials in ZMod #
We collect facts about factorials in context of modular arithmetic.
Main statements #
ZMod.cast_descFactorial: For natural numbersnandp, wherenis less than or equal topthe descending factorial of(p - 1)takenntimes modulopequals(-1) ^ n * n!.
See also #
For the prime case and involving factorial rather than descFactorial, see Wilson's theorem:
- Nat.prime_iff_fac_equiv_neg_one