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.
When finding rotations of a number, don't forget about zeroes in the middle. You should rotate honestly including zeroes (example for a not prime number):
104080 -> 040801, 408010, 080104, 801040, 010408
Use memoization in the isprime() function. You will have overhead otherwise.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #35: Circular primes
You are viewing a single comment's thread. Return to all comments →
104080 -> 040801, 408010, 080104, 801040, 010408