The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below the input, N.
Thank you Project Euler Problem 10
The test suite could match the problem statement more closely if it would test an input that was also prime. One would expect that if the input is 7, the output would be 2 + 3 + 5 since 7 is not "below" 7?
The code "sum(find((isprime(1:x))))" works well on my own computer,but in cody it keeps says "While evaluating the solution, the server encountered an error caused by long running MATLAB code. Edit the code if needed and then rescore." I don't know why, is the test x=2000000 too large!?
I think it is timing out. Why are you making your own tests anyways?
I think, in last test, x=11; answer must be 17. less then given number....
Use primes :: server encountered an error
Pritesh Shah, you are correct. Well done for spotting this when many others didn't! It could be classified as a problem with the Test Suite, but given that this is tagged as "basic matlab" it may be more fitting to amend the problem statement.
given 3 sides, find area of this triangle
The Answer to Life, the Universe, and Everything
04 - Scalar Equations 2
Is this triangle right-angled?
Find the 9's Complement
Poker Series 05: isStraight
Flag largest magnitude swings as they occur
Choose the best fitting dominoes
Implement Solitaire cipher for N long deck.
Project Euler: Problem 4, Palindromic numbers
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office