Sum of big primes without primes - MATLAB Cody - MATLAB Central

Problem 2337. Sum of big primes without primes

Difficulty:Rate
Inspired by Project Euler n°10 (I am quite obviously a fan).
With problem n°250 by Doug, you can find some global methods to compute the sum of all the primes below the input n.
For example, the sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
But how to proceed (in time) with big number and WITHOUT the primes function ?
HINTS: sum(primes(n)) is possible here but why miss the wonderfull Sieve of Eratosthenes ?

Solution Stats

39.44% Correct | 60.56% Incorrect
Last Solution submitted on Feb 14, 2025

Problem Comments

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers141

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page