Problem 53094. Easy Sequences 51: Positive Gaussian Primes
Solution Stats
Problem Comments
-
3 Comments
I have a solution that works and the entire test suite can run in 18 seconds on my laptop, but takes a little over 45 seconds to run on the server, so the server times out on the test cases.
I'm stumped trying to figure out how I can optimize this code any further.
I just re-ran the solution and this time it worked. I must have gotten a slow core the first time I ran it. ;-)
Michael Sisco and I have the same solutions, except that I skipped one check for primes (saved little or no time, as it turns out), and made it purely functional (no internal variables needed).
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
-
Which values occur exactly three times?
5234 Solvers
-
Find the peak 3n+1 sequence value
2564 Solvers
-
Give me Hamming on five, hold the mayo
55 Solvers
-
Find terms in the Connell sequence
34 Solvers
-
236 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!