Solved 5 using num::lcm.
Added solution to 6.