2018-10-10 18:03:03 -04:00
---
id: 5900f3f61000cf542c50ff09
2021-11-17 03:53:39 -08:00
title: '问题 138: 特殊的等腰三角形'
2018-10-10 18:03:03 -04:00
challengeType: 5
2021-02-06 04:42:36 +00:00
forumTopicId: 301766
2021-01-13 03:31:00 +01:00
dashedName: problem-138-special-isosceles-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-11-17 03:53:39 -08:00
考虑一个底边长为 $b = 16$,腰长为 $L = 17$ 的等腰三角形。
2018-10-10 18:03:03 -04:00
2021-11-17 03:53:39 -08:00
< img class = "img-responsive center-block" alt = "等腰三角形有两条长度相等记为 L 的腰,和一条记为 b 底;则该三角形的高 h 为从底边作高至两条腰的夹角。" src = "https://cdn.freecodecamp.org/curriculum/project-euler/special-isosceles-triangles.png" style = "background-color: white; padding: 10px;" / >
使用毕达哥拉斯定理,可以求出三角形的高为 $h = \sqrt{{17}^2 − 8^2} = 15$,恰好比底边长度小 1。
当等腰三角形底边长为 $b = 272$,腰长为 $L = 305$ 时,计算可得高为 $h = 273$,恰好比底边长度大 1, 并且这是第二小的满足性质 $h = b ± 1$ 的等腰三角形。
找到最小的 12 个满足 $h = b ± 1$ 且 $b$, $L$ 均为正整数的等腰三角形,求 $\sum{L}$。
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-11-17 03:53:39 -08:00
`isoscelesTriangles()` 应该返回 `1118049290473932` 。
2018-10-10 18:03:03 -04:00
```js
2021-11-17 03:53:39 -08:00
assert.strictEqual(isoscelesTriangles(), 1118049290473932);
2018-10-10 18:03:03 -04:00
```
2021-01-13 03:31:00 +01:00
# --seed--
## --seed-contents--
```js
2021-11-17 03:53:39 -08:00
function isoscelesTriangles() {
2021-01-13 03:31:00 +01:00
return true;
}
2021-11-17 03:53:39 -08:00
isoscelesTriangles();
2021-01-13 03:31:00 +01:00
```
2020-12-16 00:37:30 -07:00
# --solutions--
2020-08-13 17:24:35 +02:00
2021-01-13 03:31:00 +01:00
```js
// solution required
```