Cody

# Problem 1084. Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)

Solution 1794728

Submitted on 22 Apr 2019 by Ed P.
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
assert(digits_squared_chain(649) == 1)

SSD = 133 y = 133 SSD = 19 y = 19 SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

2   Pass
assert(digits_squared_chain(79) == 1)

SSD = 130 y = 130 SSD = 10 y = 10 SSD = 1 y = 1

3   Pass
assert(digits_squared_chain(608) == 1)

SSD = 100 y = 100 SSD = 1 y = 1

4   Pass
assert(digits_squared_chain(487) == 1)

SSD = 129 y = 129 SSD = 86 y = 86 SSD = 100 y = 100 SSD = 1 y = 1

5   Pass
assert(digits_squared_chain(739) == 1)

SSD = 139 y = 139 SSD = 91 y = 91 SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

6   Pass
assert(digits_squared_chain(565) == 1)

SSD = 86 y = 86 SSD = 100 y = 100 SSD = 1 y = 1

7   Pass
assert(digits_squared_chain(68) == 1)

SSD = 100 y = 100 SSD = 1 y = 1

8   Pass
assert(digits_squared_chain(383) == 1)

SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

9   Pass
assert(digits_squared_chain(379) == 1)

SSD = 139 y = 139 SSD = 91 y = 91 SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

10   Pass
assert(digits_squared_chain(203) == 1)

SSD = 13 y = 13 SSD = 10 y = 10 SSD = 1 y = 1

11   Pass
assert(digits_squared_chain(632) == 1)

SSD = 49 y = 49 SSD = 97 y = 97 SSD = 130 y = 130 SSD = 10 y = 10 SSD = 1 y = 1

12   Pass
assert(digits_squared_chain(391) == 1)

SSD = 91 y = 91 SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

13   Pass
assert(digits_squared_chain(863) == 1)

SSD = 109 y = 109 SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

14   Pass
assert(digits_squared_chain(13) == 1)

SSD = 10 y = 10 SSD = 1 y = 1

15   Pass
assert(digits_squared_chain(100) == 1)

SSD = 1 y = 1

16   Pass
assert(digits_squared_chain(236) == 1)

SSD = 49 y = 49 SSD = 97 y = 97 SSD = 130 y = 130 SSD = 10 y = 10 SSD = 1 y = 1

17   Pass
assert(digits_squared_chain(293) == 1)

SSD = 94 y = 94 SSD = 97 y = 97 SSD = 130 y = 130 SSD = 10 y = 10 SSD = 1 y = 1

18   Pass
assert(digits_squared_chain(230) == 1)

SSD = 13 y = 13 SSD = 10 y = 10 SSD = 1 y = 1

19   Pass
assert(digits_squared_chain(31) == 1)

SSD = 10 y = 10 SSD = 1 y = 1

20   Pass
assert(digits_squared_chain(806) == 1)

SSD = 100 y = 100 SSD = 1 y = 1

21   Pass
assert(digits_squared_chain(623) == 1)

SSD = 49 y = 49 SSD = 97 y = 97 SSD = 130 y = 130 SSD = 10 y = 10 SSD = 1 y = 1

22   Pass
assert(digits_squared_chain(7) == 1)

SSD = 49 y = 49 SSD = 97 y = 97 SSD = 130 y = 130 SSD = 10 y = 10 SSD = 1 y = 1

23   Pass
assert(digits_squared_chain(13) == 1)

SSD = 10 y = 10 SSD = 1 y = 1

24   Pass
assert(digits_squared_chain(836) == 1)

SSD = 109 y = 109 SSD = 82 y = 82 SSD = 68 y = 68 SSD = 100 y = 100 SSD = 1 y = 1

25   Pass
assert(digits_squared_chain(954) == 89)

SSD = 122 y = 122 SSD = 9 y = 9 SSD = 81 y = 81 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

26   Pass
assert(digits_squared_chain(567) == 89)

SSD = 110 y = 110 SSD = 2 y = 2 SSD = 4 y = 4 SSD = 16 y = 16 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

27   Pass
assert(digits_squared_chain(388) == 89)

SSD = 137 y = 137 SSD = 59 y = 59 SSD = 106 y = 106 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

28   Pass
assert(digits_squared_chain(789) == 89)

SSD = 194 y = 194 SSD = 98 y = 98 SSD = 145 y = 145 SSD = 42 y = 42 SSD = 20 y = 20 SSD = 4 y = 4 SSD = 16 y = 16 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

29   Pass
assert(digits_squared_chain(246) == 89)

SSD = 56 y = 56 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

30   Pass
assert(digits_squared_chain(787) == 89)

SSD = 162 y = 162 SSD = 41 y = 41 SSD = 17 y = 17 SSD = 50 y = 50 SSD = 25 y = 25 SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89

31   Pass
assert(digits_squared_chain(311) == 89)

SSD = 11 y = 11 SSD = 2 y = 2 SSD = 4 y = 4 SSD = 16 y = 16 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

32   Pass
assert(digits_squared_chain(856) == 89)

SSD = 125 y = 125 SSD = 30 y = 30 SSD = 9 y = 9 SSD = 81 y = 81 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

33   Pass
assert(digits_squared_chain(143) == 89)

SSD = 26 y = 26 SSD = 40 y = 40 SSD = 16 y = 16 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

34   Pass
assert(digits_squared_chain(873) == 89)

SSD = 122 y = 122 SSD = 9 y = 9 SSD = 81 y = 81 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

35   Pass
assert(digits_squared_chain(215) == 89)

SSD = 30 y = 30 SSD = 9 y = 9 SSD = 81 y = 81 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

36   Pass
assert(digits_squared_chain(995) == 89)

SSD = 187 y = 187 SSD = 114 y = 114 SSD = 18 y = 18 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

37   Pass
assert(digits_squared_chain(455) == 89)

SSD = 66 y = 66 SSD = 72 y = 72 SSD = 53 y = 53 SSD = 34 y = 34 SSD = 25 y = 25 SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89

38   Pass
assert(digits_squared_chain(948) == 89)

SSD = 161 y = 161 SSD = 38 y = 38 SSD = 73 y = 73 SSD = 58 y = 58 SSD = 89 y = 89

39   Pass
assert(digits_squared_chain(875) == 89)

SSD = 138 y = 138 SSD = 74 y = 74 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

40   Pass
assert(digits_squared_chain(788) == 89)

SSD = 177 y = 177 SSD = 99 y = 99 SSD = 162 y = 162 SSD = 41 y = 41 SSD = 17 y = 17 SSD = 50 y = 50 SSD = 25 y = 25 SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89

41   Pass
assert(digits_squared_chain(722) == 89)

SSD = 57 y = 57 SSD = 74 y = 74 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

42   Pass
assert(digits_squared_chain(250) == 89)

SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89

43   Pass
assert(digits_squared_chain(227) == 89)

SSD = 57 y = 57 SSD = 74 y = 74 SSD = 65 y = 65 SSD = 61 y = 61 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

44   Pass
assert(digits_squared_chain(640) == 89)

SSD = 52 y = 52 SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89

45   Pass
assert(digits_squared_chain(835) == 89)

SSD = 98 y = 98 SSD = 145 y = 145 SSD = 42 y = 42 SSD = 20 y = 20 SSD = 4 y = 4 SSD = 16 y = 16 SSD = 37 y = 37 SSD = 58 y = 58 SSD = 89 y = 89

46   Pass
assert(digits_squared_chain(965) == 89)

SSD = 142 y = 142 SSD = 21 y = 21 SSD = 5 y = 5 SSD = 25 y = 25 SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89

47   Pass
assert(digits_squared_chain(726) == 89)

SSD = 89 y = 89

48   Pass
assert(digits_squared_chain(689) == 89)

SSD = 181 y = 181 SSD = 66 y = 66 SSD = 72 y = 72 SSD = 53 y = 53 SSD = 34 y = 34 SSD = 25 y = 25 SSD = 29 y = 29 SSD = 85 y = 85 SSD = 89 y = 89