Cody

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

Solution 3352808

Submitted on 23 Oct 2020
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   Fail
assert(digits_squared_chain(649) == 1)

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test1 (line 1) assert(digits_squared_chain(649) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test2 (line 1) assert(digits_squared_chain(79) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test3 (line 1) assert(digits_squared_chain(608) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test4 (line 1) assert(digits_squared_chain(487) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test5 (line 1) assert(digits_squared_chain(739) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test6 (line 1) assert(digits_squared_chain(565) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test7 (line 1) assert(digits_squared_chain(68) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test8 (line 1) assert(digits_squared_chain(383) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test9 (line 1) assert(digits_squared_chain(379) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test10 (line 1) assert(digits_squared_chain(203) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test11 (line 1) assert(digits_squared_chain(632) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test12 (line 1) assert(digits_squared_chain(391) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test13 (line 1) assert(digits_squared_chain(863) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test14 (line 1) assert(digits_squared_chain(13) == 1)

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

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test16 (line 1) assert(digits_squared_chain(236) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test17 (line 1) assert(digits_squared_chain(293) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test18 (line 1) assert(digits_squared_chain(230) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test19 (line 1) assert(digits_squared_chain(31) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test20 (line 1) assert(digits_squared_chain(806) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test21 (line 1) assert(digits_squared_chain(623) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test22 (line 1) assert(digits_squared_chain(7) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test23 (line 1) assert(digits_squared_chain(13) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test24 (line 1) assert(digits_squared_chain(836) == 1)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test25 (line 1) assert(digits_squared_chain(954) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test26 (line 1) assert(digits_squared_chain(567) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test27 (line 1) assert(digits_squared_chain(388) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test28 (line 1) assert(digits_squared_chain(789) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test29 (line 1) assert(digits_squared_chain(246) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test30 (line 1) assert(digits_squared_chain(787) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test31 (line 1) assert(digits_squared_chain(311) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test32 (line 1) assert(digits_squared_chain(856) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test33 (line 1) assert(digits_squared_chain(143) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test34 (line 1) assert(digits_squared_chain(873) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test35 (line 1) assert(digits_squared_chain(215) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test36 (line 1) assert(digits_squared_chain(995) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test37 (line 1) assert(digits_squared_chain(455) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test38 (line 1) assert(digits_squared_chain(948) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test39 (line 1) assert(digits_squared_chain(875) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test40 (line 1) assert(digits_squared_chain(788) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test41 (line 1) assert(digits_squared_chain(722) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test42 (line 1) assert(digits_squared_chain(250) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test43 (line 1) assert(digits_squared_chain(227) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test44 (line 1) assert(digits_squared_chain(640) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test45 (line 1) assert(digits_squared_chain(835) == 89)

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test46 (line 1) assert(digits_squared_chain(965) == 89)

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

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

Error using str2num (line 35) Input must be a character vector or string scalar. Error in digits_squared_chain (line 6) s=s+(str2num(x(o)))^2; Error in Test48 (line 1) assert(digits_squared_chain(689) == 89)

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!