Optimized solution for Problem 12: Highly Divisible Triangle Number