Cody

Solution 1771984

Submitted on 3 Apr 2019 by Adrian Scott
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 = 9 16 25 area = 25

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

x = 9 16 25 x = 9 16 25 16 25 41 area = 41

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

x = 9 16 25 x = 9 16 25 16 25 41 x = 9 16 25 16 25 41 25 41 66 area = 66

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

x = 9 16 25 x = 9 16 25 16 25 41 x = 9 16 25 16 25 41 25 41 66 x = 9 16 25 16 25 41 25 41 66 41 66 107 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 34435 55717 90152 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 34435 55717 90152 55717 90152 145869 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 34435 55717 90152 55717 90152 145869 90152 145869 236021 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 34435 55717 90152 55717 90152 145869 90152 145869 236021 145869 236021 381890 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 34435 55717 90152 55717 90152 145869 90152 145869 236021 145869 236021 381890 236021 381890 617911 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 280 453 733 453 733 1186 733 1186 1919 1186 1919 3105 1919 3105 5024 3105 5024 8129 5024 8129 13153 8129 13153 21282 13153 21282 34435 21282 34435 55717 34435 55717 90152 55717 90152 145869 90152 145869 236021 145869 236021 381890 236021 381890 617911 381890 617911 999801 x = 9 16 25 16 25 41 25 41 66 41 66 107 66 107 173 107 173 280 173 280 453 28...