Cody

# Problem 2024. Triangle sequence

Solution 1867807

Submitted on 8 Jul 2019 by Dominik Glettler
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 = 25 x = 4 y = 5 z = 6.4031

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

area = 25 x = 4 y = 5 z = 6.4031 x = 5 y = 6.4031 z = 8.1240

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

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

### Community Treasure Hunt

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

Start Hunting!