### ----------------------------------------------------
### -- Math::Combinatorics
### -- Licenses: Artistic-2.0
### -- Authors: github:0racle
### -- File: lib/Math/Combinatorics/Utils.rakumod
### ----------------------------------------------------
unit module Math::Combinatorics::Utils;

sub factorial(int \n) is export { [×] 1 .. n }

sub subfactorial(int \n) is export {
    (1, 0, 1, -> $a, $b { ($++ + 2) * ($b + $a) } ... *)[n]
}


