I am trying to solve problem 401 of Project Euler, without giving much away, I have broken down the problem into several summations and I am trying to calculate one part, which is:

$$ \sum_{i=1}^{N/2} i (N \mod i)$$

The N is really large $10^{15}$ and it is not computationally feasible to loop so many times. I want to avoid multi-threading because that feels like cheating, so I am looking for a way to reduce this problem into something easier.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.