Project Euler problems for the most part aren't like brainteasers. Sometimes you just do not have the mathematical context to arrive at an optimal solution. Browse Wikipedia a bit or watch some math videos or something when you're stuck, and think about how to exploit the fast nature of computers with what rigorous mathematical understanding of the problem you have.
Also, I once spent over thirty cumulative hours on a single PE problem, and I never solved it, I gave up. Don't feel bad. It doesn't make you a bad programmer, just a bad mathematician. That's probably not that big of a deal!
Also, I once spent over thirty cumulative hours on a single PE problem, and I never solved it, I gave up. Don't feel bad. It doesn't make you a bad programmer, just a bad mathematician. That's probably not that big of a deal!