Cody

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

Solution 1231829

Submitted on 14 Jul 2017 by Augusto Mazzei
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)

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

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

x = 130 x = 10 x = 1 y = 1

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

x = 100 x = 1 y = 1

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

x = 129 x = 86 x = 100 x = 1 y = 1

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

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

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

x = 86 x = 100 x = 1 y = 1

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

x = 100 x = 1 y = 1

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

x = 82 x = 68 x = 100 x = 1 y = 1

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

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

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

x = 13 x = 10 x = 1 y = 1

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

x = 49 x = 97 x = 130 x = 10 x = 1 y = 1

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

x = 91 x = 82 x = 68 x = 100 x = 1 y = 1

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

x = 109 x = 82 x = 68 x = 100 x = 1 y = 1

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

x = 10 x = 1 y = 1

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

x = 1 y = 1

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

x = 49 x = 97 x = 130 x = 10 x = 1 y = 1

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

x = 94 x = 97 x = 130 x = 10 x = 1 y = 1

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

x = 13 x = 10 x = 1 y = 1

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

x = 10 x = 1 y = 1

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

x = 100 x = 1 y = 1

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

x = 49 x = 97 x = 130 x = 10 x = 1 y = 1

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

x = 49 x = 97 x = 130 x = 10 x = 1 y = 1

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

x = 10 x = 1 y = 1

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

x = 109 x = 82 x = 68 x = 100 x = 1 y = 1

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

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

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

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

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

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

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

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

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

x = 56 x = 61 x = 37 x = 58 x = 89 y = 89

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

x = 161 x = 38 x = 73 x = 58 x = 89 y = 89

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

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

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

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

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

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

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

x = 29 x = 85 x = 89 y = 89

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

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

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

x = 52 x = 29 x = 85 x = 89 y = 89

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

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

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

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

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

x = 89 y = 89

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

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