Be careful, I've implemented the sieve, but not all versions of it are sufficiently fast to handle the biggest numbers in the test suite.
While evaluating the solution, the server encountered an error caused by long running MATLAB code. Edit the code if needed and then submit.
This doesn't use primes(x),but still feels a little like cheating.
The whole point of using the sieve is not knowing which numbers are prime. So it is no different than sum(primes).
1224 Solvers
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
514 Solvers
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
227 Solvers
414 Solvers
Number of Even Elements in Fibonacci Sequence
667 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!