Cody

# Problem 2024. Triangle sequence

Solution 1047230

Submitted on 7 Nov 2016 by Sagar Rupapara
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)

H = 5 L = 4 S = 3 area = 25

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

H = 5 L = 4 S = 3 area = 25 S = 4 L = 5 H = 6.4031 area = 41

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

H = 5 L = 4 S = 3 area = 25 S = 4 L = 5 H = 6.4031 area = 41 S = 5 L = 6.4031 H = 8.1240 area = 66.0000

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

H = 5 L = 4 S = 3 area = 25 S = 4 L = 5 H = 6.4031 area = 41 S = 5 L = 6.4031 H = 8.1240 area = 66.0000 S = 6.4031 L = 8.1240 H = 10.3441 area = 107.0000 S = 8.1240 L = 10.3441 H = 13.1529 area = 173.0000 S = 10.3441 L = 13.1529 H = 16.7332 area = 280 S = 13.1529 L = 16.7332 H = 21.2838 area = 453 S = 16.7332 L = 21.2838 H = 27.0740 area = 733 S = 21.2838 L = 27.0740 H = 34.4384 area = 1.1860e+03 S = 27.0740 L = 34.4384 H = 43.8064 area = 1.9190e+03 S = 34.4384 L = 43.8064 H = 55.7225 area = 3.1050e+03 S = 43.8064 L = 55.7225 H = 70.8802 area = 5.0240e+03 S = 55.7225 L = 70.8802 H = 90.1610 area = 8.1290e+03 S = 70.8802 L = 90.1610 H = 114.6865 area = 1.3153e+04 S = 90.1610 L = 114.6865 H = 145.8835 area = 2.1282e+04 S = 114.6865 L = 145.8835 H = 185.5667 area = 3.4435e+04 S = 145.8835 L = 185.5667 H = 236.0445 area = 5.5717e+04 S = 185.5667 L = 236.0445 H = 300.2532 area = 90152 S = 236.0445 L = 300.2532 H = 381.9280 area = 1.4587e+05 S = 300.2532 L = 381.9280 H = 485.8199 area = 2.3602e+05 S = 381.9280 L = 485.8199 H = 617.9725 area = 3.8189e+05 S = 485.8199 L = 617.9725 H = 786.0732 area = 6.1791e+05 S = 617.9725 L = 786.0732 H = 999.9005 area = 9.9980e+05 S = 786.0732 L = 999.9005 H = 1.2719e+03 area = 1.6177e+06 S = 999.9005 L = 1.2719e+03 H = 1.6179e+03 area = 2.6175e+06 S = 1.2719e+03 L = 1.6179e+03 H = 2.0580e+03 area = 4.2352e+06 S = 1.6179e+03 L = 2.0580e+03 H = 2.6178e+03 area = 6.8527e+06 S = 2.0580e+03 L = 2.6178e+03 H = 3.3299e+03 area = 1.1088e+07 S = 2.6178e+03 L = 3.3299e+03 H = 4.2356e+03 area = 1.7941e+07 S = 3.3299e+03 L = 4.2356e+03 H = 5.3878e+03 area = 2.9029e+07 S = 4.2356e+03 L = 5.3878e+03 H = 6.8534e+03 area = 4.6969e+07 S = 5.3878e+03 L = 6.8534e+03 H = 8.7177e+03 area = 7.5998e+07 S = 6.8534e+03 L = 8.7177e+03 H = 1.1089e+04 area = 1.2297e+08 S = 8.7177e+03 L = 1.1089e+04 H = 1.4106e+04 area = 1.9897e+08 S = 1.1089e+04 L = 1.4106e+04 H = 1.7942e+04 area = 3.2193e+08 S = 1.4106e+04 L = 1.7942e+04 H = 2.2823e+04 area = 5.2090e+08 S = 1.7942e+04 L = 2.2823e+04 H = 2.9032e+04 area = 8.4283e+08 S = 2.2823e+04 L = 2.9032e+04 H = 3.6929e+04 area = 1.3637e+09 S = 2.9032e+04 L = 3.6929e+04 H = 4.6974e+04 area = 2.2066e+09 S = 3.6929e+04 L = 4.6974e+04 H = 5.9752e+04 area = 3.5703e+09 S = 4.6974e+04 L = 5.9752e+04 H = 7.6006e+04 area = 5.7769e+09 S = 5.9752e+04 L = 7.6006e+04 H = 9.6681e+04 area = 9.3471e+09 S = 7.6006e+04 L = 9.6681e+04 H = 1.2298e+05 area = 1.5124e+10 S = 9.6681e+04 L = 1.2298e+05 H = 1.5643e+05 area = 2.4471e+10 S = 1.2298e+05 L = 1.5643e+05 H = 1.9899e+05 area = 3.9595e+10 S = 1.5643e+05 L = 1.9899e+05 H = 2.5311e+05 area = 6.4066e+10 S = 1.9899e+05 L = 2.5311e+05 H = 3.2196e+05 area = 1.0366e+11 S = 2.5311e+05 L = 3.2196e+05 H = 4.0955e+05 area = 1.6773e+11 S = 3.2196e+05 L = 4.0955e+05 H = 5.2095e+05 area = 2.7139e+11 S = 4.0955e+05 L = 5.2095e+05 H = 6.6266e+05 area = 4.3912e+11