pub trait Multifactorial {
    fn multifactorial(n: u64, m: u64) -> Self;
}

Required Methods

Implementations on Foreign Types

Computes a multifactorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedMultifactorial.

$$ f(n, m) = n!^{(m)} = n \times (n - m) \times (n - 2m) \times \cdots \times i. $$ If $n$ is divisible by $m$, then $i$ is $m$; otherwise, $i$ is the remainder when $n$ is divided by $m$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedMultifactorial.

$$ f(n, m) = n!^{(m)} = n \times (n - m) \times (n - 2m) \times \cdots \times i. $$ If $n$ is divisible by $m$, then $i$ is $m$; otherwise, $i$ is the remainder when $n$ is divided by $m$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedMultifactorial.

$$ f(n, m) = n!^{(m)} = n \times (n - m) \times (n - 2m) \times \cdots \times i. $$ If $n$ is divisible by $m$, then $i$ is $m$; otherwise, $i$ is the remainder when $n$ is divided by $m$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedMultifactorial.

$$ f(n, m) = n!^{(m)} = n \times (n - m) \times (n - 2m) \times \cdots \times i. $$ If $n$ is divisible by $m$, then $i$ is $m$; otherwise, $i$ is the remainder when $n$ is divided by $m$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedMultifactorial.

$$ f(n, m) = n!^{(m)} = n \times (n - m) \times (n - 2m) \times \cdots \times i. $$ If $n$ is divisible by $m$, then $i$ is $m$; otherwise, $i$ is the remainder when $n$ is divided by $m$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedMultifactorial.

$$ f(n, m) = n!^{(m)} = n \times (n - m) \times (n - 2m) \times \cdots \times i. $$ If $n$ is divisible by $m$, then $i$ is $m$; otherwise, $i$ is the remainder when $n$ is divided by $m$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors