Function aoc::year2019::day16::bimonial_mod_5

source ยท
fn bimonial_mod_5(n: usize, k: usize) -> usize
Expand description

Computes C(n, k) % 5

If k is zero then the remaining coefficients are 1 so we can exit early. If r is zero then the total result is also zero so we can exit early. To save some time we only take the result modulo 5 at the end.