We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #58: Spiral primes
Project Euler #58: Spiral primes
Sort by
recency
|
32 Discussions
|
Please Login in order to post a comment
Python
I can't believe I spent so long time debugging until I realize I seived 1 as prime : (
JAva code
7- 8 cash are not pass
Can someone check/confirm the additional values for N < 8 that I found with my program (I use deterministic Miller-Rabin with the Sinclair base 2, 325, 9375, 28178, 450775, 9780504, 1795265022, see https://miller-rabin.appspot.com) ?
for N = 7: 1'213'001 (takes around 1.8 seconds) for N = 6: 10'273'345 (takes around 17 seconds) for N = 5: 204'066'345 (already takes 6 minutes to run)
1)Miller Rabin is god
2) Rest can be done using generalising the corner terms in spiral and using a while loop for increasing side by 2 till the req result in achieved.
3) I also searched for any hints in ulam spiral, for any pattern, but couldn't find any.