Cody

# Problem 2061. Narcissistic number ?

Solution 1458096

Submitted on 7 Mar 2018 by Nicolas
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 = 1; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '1' s = 0 s = 1

2   Pass
x = 9; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '9' s = 0 s = 9

3   Pass
x = 10; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

z = '10' s = 0 s = 1 s = 1

4   Pass
x = 99; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

z = '99' s = 0 s = 81 s = 162

5   Pass
x = 152; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

z = '152' s = 0 s = 1 s = 126 s = 134

6   Pass
x = 153; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '153' s = 0 s = 1 s = 126 s = 153

7   Pass
x = 154; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

z = '154' s = 0 s = 1 s = 126 s = 190

8   Pass
x = 371; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '371' s = 0 s = 27 s = 370 s = 371

9   Pass
x = 370; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '370' s = 0 s = 27 s = 370 s = 370

10   Pass
x = 1634; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '1634' s = 0 s = 1 s = 1297 s = 1378 s = 1634

11   Pass
x = 8207; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

z = '8207' s = 0 s = 4096 s = 4112 s = 4112 s = 6513

12   Pass
x = 9474; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '9474' s = 0 s = 6561 s = 6817 s = 9218 s = 9474

13   Pass
x = 9926315; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '9926315' s = 0 s = 4782969 s = 9565938 s = 9566066 s = 9846002 s = 9848189 s = 9848190 s = 9926315

14   Pass
x = 88593477; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '88593477' s = 0 s = 16777216 s = 33554432 s = 33945057 s = 76991778 s = 76998339 s = 77063875 s = 82828676 s = 88593477

15   Pass
x = 9800817; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '9800817' s = 0 s = 4782969 s = 6880121 s = 6880121 s = 6880121 s = 8977273 s = 8977274 s = 9800817

16   Pass
x = 54748; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '54748' s = 0 s = 3125 s = 4149 s = 20956 s = 21980 s = 54748

17   Pass
x = 4679307774; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '4679307774' s = 0 s = 1048576 s = 61514752 s = 343990001 s = 3.8308e+09 s = 3.8308e+09 s = 3.8308e+09 s = 4.1133e+09 s = 4.3958e+09 s = 4.6783e+09 s = 4.6793e+09

18   Pass
x = 472335975; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '472335975' s = 0 s = 262144 s = 40615751 s = 40616263 s = 40635946 s = 40655629 s = 42608754 s = 430029243 s = 470382850 s = 472335975

19   Pass
x = 32164049650; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '32164049650' s = 0 s = 177147 s = 179195 s = 179196 s = 362976252 s = 367170556 s = 367170556 s = 371364860 s = 3.1752e+10 s = 3.2115e+10 s = 3.2164e+10 s = 3.2164e+10

20   Pass
x = 32164049651; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

z = '32164049651' s = 0 s = 177147 s = 179195 s = 179196 s = 362976252 s = 367170556 s = 367170556 s = 371364860 s = 3.1752e+10 s = 3.2115e+10 s = 3.2164e+10 s = 3.2164e+10

21   Pass
x = 32164049652; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

z = '32164049652' s = 0 s = 177147 s = 179195 s = 179196 s = 362976252 s = 367170556 s = 367170556 s = 371364860 s = 3.1752e+10 s = 3.2115e+10 s = 3.2164e+10 s = 3.2164e+10