Cody

Solution 386643

Submitted on 16 Jan 2014 by priyanka shrivastava
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)

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

p = 4 b = 5 h = 6.4031

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

p = 4 b = 5 h = 6.4031 p = 5 b = 6.4031 h = 8.1240

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

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

Suggested Problems

More from this Author10