Cody

Problem 46047. Identify Wagstaff primes

Solution 3251833

Submitted on 17 Oct 2020 by ChrisR
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
n = 3; assert(isWagstaff(n))

2   Pass
n = 11; assert(isWagstaff(n))

3   Pass
n = 43; assert(isWagstaff(n))

4   Pass
n = 10923; assert(~isWagstaff(n))

5   Pass
n = 178956971; assert(~isWagstaff(n))

6   Pass
n = 2932031007403; assert(isWagstaff(n))

7   Pass
q = primes(40); n = (2.^q+1)/3; assert(isequal(isWagstaff(n),[0 1 1 1 1 1 1 1 1 0 1 0])),

Suggested Problems

More from this Author50

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!