Problem 1763. Primes for Large N: 2^30, System Memory Limit
Solution Stats
Problem Comments
-
3 Comments
Nice problem!
I have had some problems to get trough the test suite, one of them was that my primes where in UINT32 and that failed the 'isprime' assertion.
Maybe you could change the following line
pchk=p(ptr);
to
pchk=double(p(ptr));
Double implemented in test suite. Intent is to find the primes, not to get snared by errant function limitations.
Currently the MATLAB function primes is able to solve this problem. Since systems always evolve, the problem's author will probably have to be constantly updating it. Or at least, once a year.
Solution Comments
Show commentsProblem Recent Solvers19
Suggested Problems
-
Return the largest number that is adjacent to a zero
4874 Solvers
-
Return elements unique to either input
741 Solvers
-
692 Solvers
-
Sum the 'edge' values of a matrix
315 Solvers
-
330 Solvers
More from this Author260
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!