Cody

Solution 1850007

Submitted on 16 Jun 2019 by Saumyajeet Mukherjee
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)

area = 16 25

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

area = 16 25 area = 25 41

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

area = 16 25 area = 25 41 area = 41 66

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

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