Cody

Solution 465720

Submitted on 3 Jul 2014 by Chris McComb
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
%% n = 1; area_correct = 25; tolerance = 1e-12; assert(abs(triangle_sequence(n)-area_correct)<tolerance)

first = 9 second = 16 third = 25 first = 16 second = 25

2   Pass
%% n = 2; area_correct = 41; tolerance = 1e-12; assert(abs(triangle_sequence(n)-area_correct)<tolerance)

first = 9 second = 16 third = 25 first = 16 second = 25 third = 41 first = 25 second = 41

3   Pass
%% n = 3; area_correct = 66; tolerance = 1e-12; assert(abs(triangle_sequence(n)-area_correct)<tolerance)

first = 9 second = 16 third = 25 first = 16 second = 25 third = 41 first = 25 second = 41 third = 66 first = 41 second = 66

4   Pass
%% n = 50; area_correct = 439116598409; tolerance = 1e-3; assert(abs(triangle_sequence(n)-area_correct)<tolerance)

first = 9 second = 16 third = 25 first = 16 second = 25 third = 41 first = 25 second = 41 third = 66 first = 41 second = 66 third = 107 first = 66 second = 107 third = 173 first = 107 second = 173 third = 280 first = 173 second = 280 third = 453 first = 280 second = 453 third = 733 first = 453 second = 733 third = 1186 first = 733 second = 1186 third = 1919 first = 1186 second = 1919 third = 3105 first = 1919 second = 3105 third = 5024 first = 3105 second = 5024 third = 8129 first = 5024 second = 8129 third = 13153 first = 8129 second = 13153 third = 21282 first = 13153 second = 21282 third = 34435 first = 21282 second = 34435 third = 55717 first = 34435 second = 55717 third = 90152 first = 55717 second = 90152 third = 145869 first = 90152 second = 145869 third = 236021 first = 145869 second = 236021 third = 381890 first = 236021 second = 381890 third = 617911 first = 381890 second = 617911 third = 999801 first = 617911 second = 999801 third = 1617712 first = 999801 second = 1617712 third = 2617513 first = 1617712 second = 2617513 third = 4235225 first = 2617513 second = 4235225 third = 6852738 first = 4235225 second = 6852738 third = 11087963 first = 6852738 second = 11087963 third = 17940701 first = 11087963 second = 17940701 third = 29028664 first = 17940701 second = 29028664 third = 46969365 first = 29028664 second = 46969365 third = 75998029 first = 46969365 second = 75998029 third = 122967394 first = 75998029 second = 122967394 third = 198965423 first = 122967394 second = 198965423 third = 321932817 first = 198965423 second = 321932817 third = 520898240 first = 321932817 second = 520898240 third = 842831057 first = 520898240 second = 842831057 third = 1.3637e+09 first = 842831057 second = 1.3637e+09 third = 2.2066e+09 first = 1.3637e+09 second = 2.2066e+09 third = 3.5703e+09 first = 2.2066e+09 second = 3.5703e+09 third = 5.7769e+09 first = 3.5703e+09 second = 5.7769e+09 third = 9.3471e+09 first = 5.7769e+09 second = 9.3471e+09 third = 1.5124e+10 first = 9.3471e+09 second = 1.5124e+10 third = 2.4471e+10 first = 1.5124e+10 second = 2.4471e+10 third = 3.9595e+10 first = 2.4471e+10 second = 3.9595e+10 third = 6.4066e+10 first = 3.9595e+10 second = 6.4066e+10 third = 1.0366e+11 first = 6.4066e+10 second = 1.0366e+11 third = 1.6773e+11 first = 1.0366e+11 second = 1.6773e+11 third = 2.7139e+11 first = 1.6773e+11 second = 2.7139e+11 third = 4.3912e+11 first = 2.7139e+11 second = 4.3912e+11

Suggested Problems

More from this Author10