Optimized Algorithm for Highly Triangular Number