Similar to Solution 844592, this fails for large x, e.g., x = 1e16, due to floating point errors
This solution is numerically more stable than Solution 844592.
This solution fails for large x > 1e15 due to floating point errors (e.g., 1e16+0.5==1e16).
1915 Solvers
Project Euler: Problem 10, Sum of Primes
725 Solvers
528 Solvers
Matrix multiplication across rows
182 Solvers
130 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!