Cody

# Problem 166. Kaprekar numbers

Solution 13761

Submitted on 29 Jan 2012
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

2   Fail
%% x = 704; tf_correct = false; assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

3   Fail
%% x = 9 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

4   Fail
%% x = 45 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

5   Fail
%% x = 55 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

6   Fail
%% x = 99 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

7   Fail
%% x = 297 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

8   Fail
%% x = 703 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

9   Fail
%% x = 999 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

10   Fail
%% x = 2223 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

11   Fail
%% x = 2728 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

12   Fail
%% x = 4950 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

13   Fail
%% x = 5050 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

14   Fail
%% x = 7272 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

15   Fail
%% x = 7777 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

16   Fail
%% x = 9999 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

17   Fail
%% x = 17344 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

18   Fail
%% x = 22222 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

19   Fail
%% x = 77778 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

20   Fail
%% x = 82656 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

21   Fail
%% x = 95121 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

22   Fail
%% x = 99999 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

23   Fail
%% x = 142857 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

24   Fail
%% x = 148149 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

25   Fail
%% x = 181819 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

26   Fail
%% x = 187110 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

27   Fail
%% x = 208495 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

28   Fail
%% x = 318682 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

29   Fail
%% x = 329967 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

30   Fail
%% x = 351352 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

31   Fail
%% x = 356643 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

32   Fail
%% x = 390313 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

33   Fail
%% x = 461539 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

34   Fail
%% x = 466830 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

35   Fail
%% x = 499500 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

36   Fail
%% x = 500500 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

37   Fail
%% x = 533170 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

38   Fail
%% x = 538461 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

39   Fail
%% x = 609687 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

40   Fail
%% x = 643357 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

41   Fail
%% x = 648648 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

42   Fail
%% x = 670033 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

43   Fail
%% x = 681318 tf_correct = true assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

44   Fail
%% x = 681319 tf_correct = false assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.

45   Fail
%% x = 681320 tf_correct = false assert(isequal(kap(x),tf_correct))

Error: Subscript indices must either be real positive integers or logicals.