Problem 44384. Find the nearest prime number
Solution Stats
Problem Comments
-
1 Comment
Test case No. 5
x = 911;
y_correct = 911;
Should the nearest prime number for 911 have been 907?
Solution Comments
-
1 Comment
how i can solve
which is wrong
-
1 Comment
Look. It's Size 80
-
1 Comment
I feel for you, typing in those endless arrays of prime numbers.
You have probably figured it out by now, but instead of typing in manually the vectors prim0 and prim1 and then checking memberships, you can just run the function 'isprime(x)' which will save you lots of space and time
Problem Recent Solvers593
Suggested Problems
-
732 Solvers
-
475 Solvers
-
Sum of odd numbers in a matrix
397 Solvers
-
271 Solvers
-
652 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!