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.
4597 Solvers
1051 Solvers
401 Solvers
Determine if input is a Narcissistic number
120 Solvers
184 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!