I think that with this kind of problem, you can process in two steps.
A first easy problem with small N (to test perms for example). And a harder problem with big N, which
oblige to find another algorithm.
http://oeis.org/A000166
1423 Solvers
The Goldbach Conjecture, Part 2
1286 Solvers
Project Euler: Problem 3, Largest prime factor
385 Solvers
Project Euler: Problem 7, Nth prime
527 Solvers
399 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!