Cody

Problem 2024. Triangle sequence

Solution 2799079

Submitted on 6 Aug 2020 by Anush Reddy pittu
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)

a = 3 b = 4 c = 5 area = 25

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

a = 3 b = 4 c = 5 seclon = 5 short = 4 long = 6.4031 c = 6.4031 b = 5 area = 41

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

a = 3 b = 4 c = 5 seclon = 5 short = 4 long = 6.4031 c = 6.4031 b = 5 seclon = 6.4031 short = 5 long = 8.1240 c = 8.1240 b = 6.4031 area = 66.0000

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

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

Suggested Problems

More from this Author10

Community Treasure Hunt

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

Start Hunting!