Cody

# Problem 2024. Triangle sequence

Solution 1759611

Submitted on 24 Mar 2019 by Oliver Braatz
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 = 25

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

area = 41

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

a = 25 b = 41 c = 66 a = 41 b = 66 area = 66

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

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

### Community Treasure Hunt

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

Start Hunting!