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 #49: Prime permutations
Project Euler #49: Prime permutations
Sort by
recency
|
23 Discussions
|
Please Login in order to post a comment
100% python
itertools permutations, and groupby are very helpful things to learn for this one!
Solution for n=1000000, k=3
If you are having timout issues, I recommend implementing sieve to get the relevant prime numbers, and using itertools permutations. The key is not to run itertools on every prime. As you go along, apply the same permutation list to all the primes in the list to optimize speed. I recommend splicing only the larger primes. Good luck!
Leading zeros? Clarification would be nice