Optimizing Project Euler #12 (Python 3)
Project Euler problems are more about math than programming.

You must prove (or at least observe) the following:


An nth triangular number is \$\dfrac{n(n+1)}{2}\$. One of the numerator's factors is obviously even.
The number_of_divisors is a multiplicative function (known as \$\sigma\$), meaning that if \$m\$ and \$n\$ are coprime, then \$\sigma(mn) = \sigma(m)\cdot\sigma(n)\$
\$n\$ and \$n+1\$ are necessarily coprime.
Once you computed \$\sigma(n)\$ and \$\sigma(n+1)\$ on a certain iteration, on the next iteration you'd only need to compute \$\sigma(n+2)\$. Using memoization, you may even avoid this when \$n+2\$ is even.


This should be enough to build an efficient solution.