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 Solvers608
Suggested Problems
-
The Answer to Life, the Universe, and Everything
477 Solvers
-
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
434 Solvers
-
Find the dimensions of a matrix
472 Solvers
-
249 Solvers
-
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
913 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!