Added num_factors function for problem 12.
Added is_triangular function for problem 12.