Functional programming often gets criticized as being slow, so I wanted to present an example where it is in fact several times faster than the equivalent imperative code1. The problem is to count the lengths of Collatz sequences, which you may remember from here. In Rust, this is straightforward: fn modular(a: i64, b: i64) -> i64 { ((a % b) + b) % b } pub fn collatz_length(mut i: i64) -> i64 { le

