This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!
Submit FeedbackLooks like my initial inclination to run through all possible combinations was virtually identical to many of the previous entries. This is the naïve and most obvious approach.
For fun, I ran the workflow for larger values of N to see how long it took:
N = 1000 - 2.1 seconds (168 primes)
N = 10,000 - 79 seconds (1,229 primes)
My Solution attached