unroll loops, pull n into scope of find_one_factor