Cody

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

Solution 265726

Submitted on 23 Jun 2013 by Mehmet OZC
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)

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```

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

```[Warning: FOR loop index is too large. Truncating to 9223372036854775807.] [> In digits_squared_chain at 2 In verifyCode>evaluateCode at 227 In verifyCode at 40 In fevalJSON at 14 In workspacefunc at 7] ```