Cody

# Problem 2024. Triangle sequence

Solution 828006

Submitted on 15 Feb 2016 by nag
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)

x3 = 6.4031 area = 41

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

x3 = 6.4031 x3 = 8.1240 area = 66

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

x3 = 6.4031 x3 = 8.1240 x3 = 10.3441 x3 = 13.1529 x3 = 16.7332 x3 = 21.2838 x3 = 27.0740 x3 = 34.4384 x3 = 43.8064 x3 = 55.7225 x3 = 70.8802 x3 = 90.1610 x3 = 114.6865 x3 = 145.8835 x3 = 185.5667 x3 = 236.0445 x3 = 300.2532 x3 = 381.9280 x3 = 485.8199 x3 = 617.9725 x3 = 786.0732 x3 = 999.9005 x3 = 1.2719e+03 x3 = 1.6179e+03 x3 = 2.0580e+03 x3 = 2.6178e+03 x3 = 3.3299e+03 x3 = 4.2356e+03 x3 = 5.3878e+03 x3 = 6.8534e+03 x3 = 8.7177e+03 x3 = 1.1089e+04 x3 = 1.4106e+04 x3 = 1.7942e+04 x3 = 2.2823e+04 x3 = 2.9032e+04 x3 = 3.6929e+04 x3 = 4.6974e+04 x3 = 5.9752e+04 x3 = 7.6006e+04 x3 = 9.6681e+04 x3 = 1.2298e+05 x3 = 1.5643e+05 x3 = 1.9899e+05 x3 = 2.5311e+05 x3 = 3.2196e+05 x3 = 4.0955e+05 x3 = 5.2095e+05 x3 = 6.6266e+05 area = 4.3912e+11