Cody

Solution 2165164

Submitted on 19 Mar 2020 by Isabel Haupt
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)

x = 3 4 5 area = 25

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

x = 3 4 5 z = 41 y = 6.4031 x = 4.0000 5.0000 6.4031 area = 41

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

x = 3 4 5 z = 41 y = 6.4031 x = 4.0000 5.0000 6.4031 z = 66 y = 8.1240 x = 5.0000 6.4031 8.1240 area = 66.0000

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

x = 3 4 5 z = 41 y = 6.4031 x = 4.0000 5.0000 6.4031 z = 66 y = 8.1240 x = 5.0000 6.4031 8.1240 z = 107.0000 y = 10.3441 x = 6.4031 8.1240 10.3441 z = 173.0000 y = 13.1529 x = 8.1240 10.3441 13.1529 z = 280.0000 y = 16.7332 x = 10.3441 13.1529 16.7332 z = 453.0000 y = 21.2838 x = 13.1529 16.7332 21.2838 z = 733 y = 27.0740 x = 16.7332 21.2838 27.0740 z = 1186 y = 34.4384 x = 21.2838 27.0740 34.4384 z = 1.9190e+03 y = 43.8064 x = 27.0740 34.4384 43.8064 z = 3.1050e+03 y = 55.7225 x = 34.4384 43.8064 55.7225 z = 5.0240e+03 y = 70.8802 x = 43.8064 55.7225 70.8802 z = 8.1290e+03 y = 90.1610 x = 55.7225 70.8802 90.1610 z = 1.3153e+04 y = 114.6865 x = 70.8802 90.1610 114.6865 z = 2.1282e+04 y = 145.8835 x = 90.1610 114.6865 145.8835 z = 3.4435e+04 y = 185.5667 x = 114.6865 145.8835 185.5667 z = 5.5717e+04 y = 236.0445 x = 145.8835 185.5667 236.0445 z = 9.0152e+04 y = 300.2532 x = 185.5667 236.0445 300.2532 z = 145869 y = 381.9280 x = 236.0445 300.2532 381.9280 z = 2.3602e+05 y = 485.8199 x = 300.2532 381.9280 485.8199 z = 3.8189e+05 y = 617.9725 x = 381.9280 485.8199 617.9725 z = 6.1791e+05 y = 786.0732 x = 485.8199 617.9725 786.0732 z = 9.9980e+05 y = 999.9005 x = 617.9725 786.0732 999.9005 z = 1.6177e+06 y = 1.2719e+03 x = 1.0e+03 * 0.7861 0.9999 1.2719 z = 2.6175e+06 y = 1.6179e+03 x = 1.0e+03 * 0.9999 1.2719 1.6179 z = 4.2352e+06 y = 2.0580e+03 x = 1.0e+03 * 1.2719 1.6179 2.0580 z = 6.8527e+06 y = 2.6178e+03 x = 1.0e+03 * 1.6179 2.0580 2.6178 z = 1.1088e+07 y = 3.3299e+03 x = 1.0e+03 * 2.0580 2.6178 3.3299 z = 1.7941e+07 y = 4.2356e+03 x = 1.0e+03 * 2.6178 3.3299 4.2356 z = 2.9029e+07 y = 5.3878e+03 x = 1.0e+03 * 3.3299 4.2356 5.3878 z = 4.6969e+07 y = 6.8534e+03 x = 1.0e+03 * 4.2356 5.3878 6.8534 z = 7.5998e+07 y = 8.7177e+03 x = 1.0e+03 * 5.3878 6.8534 8.7177 z = 1.2297e+08 y = 1.1089e+04 x = 1.0e+04 * 0.6853 0.8718 1.1089 z = 1.9897e+08 y = 1.4106e+04 x = 1.0e+04 * 0.8718 1.1089 1.4106 z = 3.2193e+08 y = 1.7942e+04 x = 1.0e+04 * 1.1089 1.4106 1.7942 z = 5.2090e+08 y = 2.2823e+04 x = 1.0e+04 * 1.4106 1.7942 2.2823 z = 8.4283e+08 y = 2.9032e+04 x = 1.0e+04 * 1.7942 2.2823 2.9032 z = 1.3637e+09 y = 3.6929e+04 x = 1.0e+04 * 2.2823 2.9032 3.6929 z = 2.2066e+09 y = 4.6974e+04 x = 1.0e+04 * 2.9032 3.6929 4.6974 z = 3.5703e+09 y = 5.9752e+04 x = 1.0e+04 * 3.6929 4.6974 5.9752 z = 5.7769e+09 y = 7.6006e+04 x = 1.0e+04 * 4.6974 5.9752 7.6006 z = 9.3471e+09 y = 9.6681e+04 x = 1.0e+04 * 5.9752 7.6006 9.6681 z = 1.5124e+10 y = 1.2298e+05 x = 1.0e+05 * 0.7601 0.9668 1.2298 z = 2.4471e+10 y = 1.5643e+05 x = 1.0e+05 * 0.9668 1.2298 1.5643 z = 3.9595e+10 y = 1.9899e+05 x = 1.0e+05 * 1.2298 1.5643 1.9899 z = 6.4066e+10 y = 2.5311e+05 x = 1.0e+05 * 1.5643 1.9899 2.5311 z = 1.0366e+11 y = 3.2196e+05 x = 1.0e+05 * 1.9899 2.5311 3.2196 z = 1.6773e+11 y = 4.0955e+05 x = 1.0e+05 * 2.5311 3.2196 4.0955 z = 2.7139e+11 y = 5.2095e+05 x = 1.0e+05 * 3.2196 4.0955 5.2095 z = 4.3912e+11 y = 6.6266e+05 x = 1.0e+05 * 4.0955 5.2095 6.6266 area = 4.3912e+11

Suggested Problems

More from this Author10