In one of the problems that I'm solving on Project Euler, I'm trying to find the first triangle number that has 500 divisors. However, the thing is that my code slows to a crawl after three million. I only have two variables, no macros, no global variables, I'm not storing a triangle number but rather using a formula to determine it, and using only two printfs where one displays the triangle number and the other displays the final result. How do I maintain that speed so that it'll be quicker? Would pointers do the trick or do I need to take a drastic measure such as learning assembly?