Cody

Problem 525. Mersenne Primes

Solution 2914495

Submitted on 5 Sep 2020
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   Fail
x = 3; y_correct = true; assert(isequal(isMersenne(x),y_correct))

Assertion failed.

2   Fail
x = 127; y_correct = true; assert(isequal(isMersenne(x),y_correct))

Assertion failed.

3   Pass
x = 157; y_correct = false; assert(isequal(isMersenne(x),y_correct))

4   Pass
x = 2047; y_correct = false; assert(isequal(isMersenne(x),y_correct))

5   Fail
x = 8191; y_correct = true; assert(isequal(isMersenne(x),y_correct))

Assertion failed.

6   Fail
x = 524287; y_correct = true; assert(isequal(isMersenne(x),y_correct))

Assertion failed.

7   Pass
x = 536870911; y_correct = false; assert(isequal(isMersenne(x),y_correct))


Community Treasure Hunt

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

Start Hunting!