I loosened the tolerance on the test for s = 2. Increasing the number of primes seems to degrade the accuracy after a certain point, and the result becomes farther from the value listed in sequence A085548 in the Online Encyclopedia of Integer Sequences. This solution should pass now.
229 Solvers
Rosenbrock's Banana Function and its derivatives
121 Solvers
70 Solvers
2602 Solvers
43 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!