Cody

# Problem 2024. Triangle sequence

Solution 1586418

Submitted on 18 Jul 2018 by Ankith Rathod
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)

y = 3 4 5 area = 25

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

y = 3 4 5 y = 4 5 y = 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)

y = 3 4 5 y = 4 5 y = 4.0000 5.0000 6.4031 y = 5.0000 6.4031 y = 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)

y = 3 4 5 y = 4 5 y = 4.0000 5.0000 6.4031 y = 5.0000 6.4031 y = 5.0000 6.4031 8.1240 y = 6.4031 8.1240 y = 6.4031 8.1240 10.3441 y = 8.1240 10.3441 y = 8.1240 10.3441 13.1529 y = 10.3441 13.1529 y = 10.3441 13.1529 16.7332 y = 13.1529 16.7332 y = 13.1529 16.7332 21.2838 y = 16.7332 21.2838 y = 16.7332 21.2838 27.0740 y = 21.2838 27.0740 y = 21.2838 27.0740 34.4384 y = 27.0740 34.4384 y = 27.0740 34.4384 43.8064 y = 34.4384 43.8064 y = 34.4384 43.8064 55.7225 y = 43.8064 55.7225 y = 43.8064 55.7225 70.8802 y = 55.7225 70.8802 y = 55.7225 70.8802 90.1610 y = 70.8802 90.1610 y = 70.8802 90.1610 114.6865 y = 90.1610 114.6865 y = 90.1610 114.6865 145.8835 y = 114.6865 145.8835 y = 114.6865 145.8835 185.5667 y = 145.8835 185.5667 y = 145.8835 185.5667 236.0445 y = 185.5667 236.0445 y = 185.5667 236.0445 300.2532 y = 236.0445 300.2532 y = 236.0445 300.2532 381.9280 y = 300.2532 381.9280 y = 300.2532 381.9280 485.8199 y = 381.9280 485.8199 y = 381.9280 485.8199 617.9725 y = 485.8199 617.9725 y = 485.8199 617.9725 786.0732 y = 617.9725 786.0732 y = 617.9725 786.0732 999.9005 y = 786.0732 999.9005 y = 1.0e+03 * 0.7861 0.9999 1.2719 y = 1.0e+03 * 0.9999 1.2719 y = 1.0e+03 * 0.9999 1.2719 1.6179 y = 1.0e+03 * 1.2719 1.6179 y = 1.0e+03 * 1.2719 1.6179 2.0580 y = 1.0e+03 * 1.6179 2.0580 y = 1.0e+03 * 1.6179 2.0580 2.6178 y = 1.0e+03 * 2.0580 2.6178 y = 1.0e+03 * 2.0580 2.6178 3.3299 y = 1.0e+03 * 2.6178 3.3299 y = 1.0e+03 * 2.6178 3.3299 4.2356 y = 1.0e+03 * 3.3299 4.2356 y = 1.0e+03 * 3.3299 4.2356 5.3878 y = 1.0e+03 * 4.2356 5.3878 y = 1.0e+03 * 4.2356 5.3878 6.8534 y = 1.0e+03 * 5.3878 6.8534 y = 1.0e+03 * 5.3878 6.8534 8.7177 y = 1.0e+03 * 6.8534 8.7177 y = 1.0e+04 * 0.6853 0.8718 1.1089 y = 1.0e+04 * 0.8718 1.1089 y = 1.0e+04 * 0.8718 1.1089 1.4106 y = 1.0e+04 * 1.1089 1.4106 y = 1.0e+04 * 1.1089 1.4106 1.7942 y = 1.0e+04 * 1.4106 1.7942 y = 1.0e+04 * 1.4106 1.7942 2.2823 y = 1.0e+04 * 1.7942 2.2823 y = 1.0e+04 * 1.7942 2.2823 2.9032 y = 1.0e+04 * 2.2823 2.9032 y = 1.0e+04 * 2.2823 2.9032 3.6929 y = 1.0e+04 * 2.9032 3.6929 y = 1.0e+04 * 2.9032 3.6929 4.6974 y = 1.0e+04 * 3.6929 4.6974 y = 1.0e+04 * 3.6929 4.6974 5.9752 y = 1.0e+04 * 4.6974 5.9752 y = 1.0e+04 * 4.6974 5.9752 7.6006 y = 1.0e+04 * 5.9752 7.6006 y = 1.0e+04 * 5.9752 7.6006 9.6681 y = 1.0e+04 * 7.6006 9.6681 y = 1.0e+05 * 0.7601 0.9668 1.2298 y = 1.0e+05 * 0.9668 1.2298 y = 1.0e+05 * 0.9668 1.2298 1.5643 y = 1.0e+05 * 1.2298 1.5643 y = 1.0e+05 * 1.2298 1.5643 1.9899 y = 1.0e+05 * 1.5643 1.9899 y = 1.0e+05 * 1.5643 1.9899 2.5311 y = 1.0e+05 * 1.9899 2.5311 y = 1.0e+05 * 1.9899 2.5311 3.2196 y = 1.0e+05 * 2.5311 3.2196 y = 1.0e+05 * 2.5311 3.2196 4.0955 y = 1.0e+05 * 3.2196 4.0955 y = 1.0e+05 * 3.2196 4.0955 5.2095 y = 1.0e+05 * 4.0955 5.2095 y = 1.0e+05 * 4.0955 5.2095 6.6266 area = 4.3912e+11