Cody

# Problem 2024. Triangle sequence

Solution 1831224

Submitted on 30 May 2019 by Yuzhu Zhang
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 = 9 16 25

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

A = 9 16 25 A = 9 16 25 41

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

A = 9 16 25 A = 9 16 25 41 A = 9 16 25 41 66

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

A = 9 16 25 A = 9 16 25 41 A = 9 16 25 41 66 A = 9 16 25 41 66 107 A = 9 16 25 41 66 107 173 A = 9 16 25 41 66 107 173 280 A = 9 16 25 41 66 107 173 280 453 A = 9 16 25 41 66 107 173 280 453 733 A = 9 16 25 41 66 107 173 280 453 733 1186 A = 9 16 25 41 66 107 173 280 453 733 1186 1919 A = 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 A = 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 A = 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Column 16 13153 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 17 13153 21282 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 18 13153 21282 34435 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 19 13153 21282 34435 55717 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 20 13153 21282 34435 55717 90152 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 21 13153 21282 34435 55717 90152 145869 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 22 13153 21282 34435 55717 90152 145869 236021 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 23 13153 21282 34435 55717 90152 145869 236021 381890 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 24 13153 21282 34435 55717 90152 145869 236021 381890 617911 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 25 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 26 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 27 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 28 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 29 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Column 31 17940701 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Columns 31 through 32 17940701 29028664 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Columns 31 through 33 17940701 29028664 46969365 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Columns 31 through 34 17940701 29028664 46969365 75998029 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Columns 31 through 35 17940701 29028664 46969365 75998029 122967394 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Columns 31 through 36 17940701 29028664 46969365 75998029 122967394 198965423 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 999801 1617712 2617513 4235225 6852738 11087963 Columns 31 through 37 17940701 29028664 46969365 75998029 122967394 198965423 321932817 A = Columns 1 through 15 9 16 25 41 66 107 173 280 453 733 1186 1919 3105 5024 8129 Columns 16 through 30 13153 21282 34435 55717 90152 145869 236021 381890 617911 ...