Cody

Problem 42673. Longest Collatz Sequence

Solution 1618800

Submitted on 29 Aug 2018
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
x = 10; assert(isequal(euler14(x),9))

N = 10

Assertion failed.

2   Fail
x = 100; assert(isequal(euler14(x),97))

N = 100

Assertion failed.

3   Fail
x = 96; assert(isequal(euler14(x),73))

N = 96

Assertion failed.

4   Fail
x = 1000; assert(isequal(euler14(x),871))

N = 1000

Assertion failed.

5   Fail
x = 870; assert(isequal(euler14(x),703))

N = 870

Assertion failed.

6   Fail
assert(isequal(euler14(871),871))

N = 871

Assertion failed.

7   Fail
x = 77030; assert(isequal(euler14(x),52527))

N = 77030

Assertion failed.

8   Fail
x = 77031; assert(isequal(euler14(x),77031))

N = 77031

Assertion failed.

9   Fail
assert(isequal(euler14(500000),410011))

N = 500000

Assertion failed.

10   Fail
z = 900000; y_correct=837799; assert(isequal(euler14(z),y_correct))

N = 900000

Assertion failed.

Suggested Problems

More from this Author43

Community Treasure Hunt

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

Start Hunting!