Cody

Problem 44385. Extra safe primes

Solution 1958329

Submitted on 3 Oct 2019
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
x = 0; assert(isequal(isextrasafe(x),false))

2   Fail
x = 5; assert(isequal(isextrasafe(x),false))

Index exceeds the number of array elements (1). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test2 (line 2) assert(isequal(isextrasafe(x),false))

3   Fail
x = 7; assert(isequal(isextrasafe(x),false))

Index exceeds the number of array elements (2). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test3 (line 2) assert(isequal(isextrasafe(x),false))

4   Fail
x = 11; assert(isequal(isextrasafe(x),true))

Index exceeds the number of array elements (3). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test4 (line 2) assert(isequal(isextrasafe(x),true))

5   Fail
x = 15; assert(isequal(isextrasafe(x),false))

Index exceeds the number of array elements (4). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test5 (line 2) assert(isequal(isextrasafe(x),false))

6   Fail
x = 23; assert(isequal(isextrasafe(x),true))

Index exceeds the number of array elements (5). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test6 (line 2) assert(isequal(isextrasafe(x),true))

7   Fail
x = 71; assert(isequal(isextrasafe(x),false))

Index exceeds the number of array elements (11). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test7 (line 2) assert(isequal(isextrasafe(x),false))

8   Fail
x = 719; assert(isequal(isextrasafe(x),true))

Index exceeds the number of array elements (72). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test8 (line 2) assert(isequal(isextrasafe(x),true))

9   Fail
x = 2039; assert(isequal(isextrasafe(x),true))

Index exceeds the number of array elements (171). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test9 (line 2) assert(isequal(isextrasafe(x),true))

10   Fail
x = 2040; assert(isequal(isextrasafe(x),false))

Index exceeds the number of array elements (171). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test10 (line 2) assert(isequal(isextrasafe(x),false))

11   Fail
x = 5807; assert(isequal(isextrasafe(x),true))

Index exceeds the number of array elements (420). Error in isextrasafe (line 7) if (x == (primes_vec(i)*2 +1)) Error in Test11 (line 2) assert(isequal(isextrasafe(x),true))