Cody

# Problem 2024. Triangle sequence

Solution 1704884

Submitted on 8 Jan 2019 by Chris Breshike
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)

area = 41 area = 66.0000

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

area = 41 area = 66.0000 area = 107.0000 area = 173.0000 area = 280 area = 453 area = 733 area = 1.1860e+03 area = 1.9190e+03 area = 3.1050e+03 area = 5.0240e+03 area = 8.1290e+03 area = 1.3153e+04 area = 2.1282e+04 area = 3.4435e+04 area = 5.5717e+04 area = 90152 area = 1.4587e+05 area = 2.3602e+05 area = 3.8189e+05 area = 6.1791e+05 area = 9.9980e+05 area = 1.6177e+06 area = 2.6175e+06 area = 4.2352e+06 area = 6.8527e+06 area = 1.1088e+07 area = 1.7941e+07 area = 2.9029e+07 area = 4.6969e+07 area = 7.5998e+07 area = 1.2297e+08 area = 1.9897e+08 area = 3.2193e+08 area = 5.2090e+08 area = 8.4283e+08 area = 1.3637e+09 area = 2.2066e+09 area = 3.5703e+09 area = 5.7769e+09 area = 9.3471e+09 area = 1.5124e+10 area = 2.4471e+10 area = 3.9595e+10 area = 6.4066e+10 area = 1.0366e+11 area = 1.6773e+11 area = 2.7139e+11 area = 4.3912e+11

### Community Treasure Hunt

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

Start Hunting!