Cody

# Problem 2024. Triangle sequence

Solution 1058464

Submitted on 22 Nov 2016 by Lucinda King
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)

FS = 3 4 F2L = 4 5 FH = 5.0000 6.4031

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

FS = 3 4 F2L = 4 5 FH = 5.0000 6.4031 FS = 3 4 5 F2L = 4.0000 5.0000 6.4031 FH = 5.0000 6.4031 8.1240

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

FS = 3 4 F2L = 4 5 FH = 5.0000 6.4031 FS = 3 4 5 F2L = 4.0000 5.0000 6.4031 FH = 5.0000 6.4031 8.1240 FS = 3.0000 4.0000 5.0000 6.4031 F2L = 4.0000 5.0000 6.4031 8.1240 FH = 5.0000 6.4031 8.1240 10.3441 FS = 3.0000 4.0000 5.0000 6.4031 8.1240 F2L = 4.0000 5.0000 6.4031 8.1240 10.3441 FH = 5.0000 6.4031 8.1240 10.3441 13.1529 FS = 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 F2L = 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 FH = 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 FS = 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 F2L = 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 FH = 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 FS = 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 F2L = 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 FH = 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 FS = 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 F2L = 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 FH = 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Column 10 27.0740 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Column 10 34.4384 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Column 10 43.8064 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 11 27.0740 34.4384 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 11 34.4384 43.8064 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 11 43.8064 55.7225 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 12 27.0740 34.4384 43.8064 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 12 34.4384 43.8064 55.7225 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 12 43.8064 55.7225 70.8802 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 13 27.0740 34.4384 43.8064 55.7225 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 13 34.4384 43.8064 55.7225 70.8802 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 13 43.8064 55.7225 70.8802 90.1610 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 14 27.0740 34.4384 43.8064 55.7225 70.8802 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 14 34.4384 43.8064 55.7225 70.8802 90.1610 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 14 43.8064 55.7225 70.8802 90.1610 114.6865 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 15 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 15 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 15 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 16 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 16 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 16 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 17 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 17 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 17 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 18 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 18 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 18 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 300.2532 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 18 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 Column 19 236.0445 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 18 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 Column 19 300.2532 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 18 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 300.2532 Column 19 381.9280 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 18 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 Columns 19 through 20 236.0445 300.2532 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 18 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 Columns 19 through 20 300.2532 381.9280 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 18 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 300.2532 Columns 19 through 20 381.9280 485.8199 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 18 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 Columns 19 through 21 236.0445 300.2532 381.9280 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 18 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 Columns 19 through 21 300.2532 381.9280 485.8199 FH = Columns 1 through 9 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 34.4384 Columns 10 through 18 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 300.2532 Columns 19 through 21 381.9280 485.8199 617.9725 FS = Columns 1 through 9 3.0000 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 Columns 10 through 18 27.0740 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 Columns 19 through 22 236.0445 300.2532 381.9280 485.8199 F2L = Columns 1 through 9 4.0000 5.0000 6.4031 8.1240 10.3441 13.1529 16.7332 21.2838 27.0740 Columns 10 through 18 34.4384 43.8064 55.7225 70.8802 90.1610 114.6865 145.8835 185.5667 236.0445 Columns 19 through 22 300.2532 381.9280 485.8...

### Community Treasure Hunt

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

Start Hunting!