Cody

# Problem 2736. Pernicious Anniversary Problem

Solution 1397105

Submitted on 29 Dec 2017 by Francis Naldo
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 = 5; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 0 x = 5 ans = 1 x = 1 ans = 1 x = 1 ans = 2 x = 0 ans = logical 1

2   Pass
x = 1; y_correct = false; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 0 x = 1 ans = 1 x = 0 ans = logical 0

3   Pass
x = 2^randi(16); y_correct = false; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 0 x = 512 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = 1 x = 0 ans = logical 0

4   Pass
x = 17; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 0 x = 17 ans = 1 x = 1 ans = 1 x = 1 ans = 1 x = 1 ans = 1 x = 1 ans = 2 x = 0 ans = logical 1

5   Pass
x = 18; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 0 x = 18 ans = 1 x = 2 ans = 1 x = 2 ans = 1 x = 2 ans = 2 x = 0 ans = 2 x = 0 ans = logical 1

6   Pass
x = 61; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 0 x = 61 ans = 1 x = 29 ans = 2 x = 13 ans = 3 x = 5 ans = 4 x = 1 ans = 4 x = 1 ans = 5 x = 0 ans = logical 1

7   Pass
x = 6; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 0 x = 6 ans = 1 x = 2 ans = 2 x = 0 ans = 2 x = 0 ans = logical 1

8   Pass
x = 2115; y_correct = false; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 0 x = 2115 ans = 1 x = 67 ans = 1 x = 67 ans = 1 x = 67 ans = 1 x = 67 ans = 1 x = 67 ans = 2 x = 3 ans = 2 x = 3 ans = 2 x = 3 ans = 2 x = 3 ans = 2 x = 3 ans = 3 x = 1 ans = 4 x = 0 ans = logical 0

9   Pass
x = 2114; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 0 x = 2114 ans = 1 x = 66 ans = 1 x = 66 ans = 1 x = 66 ans = 1 x = 66 ans = 1 x = 66 ans = 2 x = 2 ans = 2 x = 2 ans = 2 x = 2 ans = 2 x = 2 ans = 2 x = 2 ans = 3 x = 0 ans = 3 x = 0 ans = logical 1

10   Pass
x = 2017; y_correct = true; assert(isequal(isPernicious(x),y_correct))

ans = 0 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 0 x = 2017 ans = 1 x = 993 ans = 2 x = 481 ans = 3 x = 225 ans = 4 x = 97 ans = 5 x = 33 ans = 6 x = 1 ans = 6 x = 1 ans = 6 x = 1 ans = 6 x = 1 ans = 6 x = 1 ans = 7 x = 0 ans = logical 1