Skip to main content

fuss_catalan

Function fuss_catalan 

Source
pub fn fuss_catalan(order: u64, n: u64) -> Result<u128, CatalanError>
Expand description

Returns the nth Fuss-Catalan number for a positive order.

order = 2 matches the standard Catalan sequence.

§Errors

Returns CatalanError::ZeroOrder when order == 0.

Returns CatalanError::FussCatalanOverflow when the result no longer fits in u128.

§Examples

use use_catalan::fuss_catalan;

assert_eq!(fuss_catalan(3, 3)?, 12);