Cody

Problem 46047. Identify Wagstaff primes

Solution 2723481

Submitted on 21 Jul 2020 by Tim
  • Size: 31
  • This is the leading solution.
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])),