2018-10-10 18:03:03 -04:00
---
id: 5900f4ee1000cf542c510000
2021-02-06 04:42:36 +00:00
title: 'Problem 385: Ellipses inside triangles'
2018-10-10 18:03:03 -04:00
challengeType: 5
2021-02-06 04:42:36 +00:00
forumTopicId: 302049
2021-01-13 03:31:00 +01:00
dashedName: problem-385-ellipses-inside-triangles
2018-10-10 18:03:03 -04:00
---
2020-12-16 00:37:30 -07:00
# --description--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
For any triangle T in the plane, it can be shown that there is a unique ellipse with largest area that is completely inside T.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
For a given n, consider triangles T such that:
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
- the vertices of T have integer coordinates with absolute value ≤ n, and
- the foci1 of the largest-area ellipse inside T are (√13,0) and (-√13,0).
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
Let A(n) be the sum of the areas of all such triangles.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
For example, if n = 8, there are two such triangles. Their vertices are (-4,-3),(-4,3),(8,0) and (4,3),(4,-3),(-8,0), and the area of each triangle is 36. Thus A(8) = 36 + 36 = 72.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
It can be verified that A(10) = 252, A(100) = 34632 and A(1000) = 3529008.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
Find A(1 000 000 000).
1The foci (plural of focus) of an ellipse are two points A and B such that for every point P on the boundary of the ellipse, AP + PB is constant.
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
# --hints--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
`euler385()` should return 3776957309612154000.
2018-10-10 18:03:03 -04:00
```js
2020-12-16 00:37:30 -07:00
assert.strictEqual(euler385(), 3776957309612154000);
2018-10-10 18:03:03 -04:00
```
2020-08-13 17:24:35 +02:00
2021-01-13 03:31:00 +01:00
# --seed--
## --seed-contents--
```js
function euler385() {
return true;
}
euler385();
```
2020-12-16 00:37:30 -07:00
# --solutions--
2021-01-13 03:31:00 +01:00
```js
// solution required
```