The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38
Find the sum of all the positive non-prime integers that do not exceed the input, N.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers572
Suggested Problems
-
395 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13620 Solvers
-
325 Solvers
-
567 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
399 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The description of the problem is slightly misleading. It says the sum "below" 10, yet the sum includes 10. It should be ammended to "Find the sum of all the non-primes below the input, and including the input, N.", or something to that effect.
I've now fixed the problem statement to be consistent.