Cody

# Problem 2024. Triangle sequence

Solution 1767301

Submitted on 30 Mar 2019 by Zoltán Nagy
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)

A = 9 16 25

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

A = 9 16 25 A = 16 25 41

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

A = 9 16 25 A = 16 25 41 A = 25 41 66

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

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