2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f4461000cf542c50ff59
|
|
|
|
title: 'Problem 218: Perfect right-angled triangles'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 301860
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-218-perfect-right-angled-triangles
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --description--
|
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
Consider the right-angled triangle with sides $a=7$, $b=24$ and $c=25$.
|
2020-11-27 18:02:05 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
The area of this triangle is 84, which is divisible by the perfect numbers 6 and 28.
|
2020-11-27 18:02:05 +00:00
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
Moreover it is a primitive right-angled triangle as $gcd(a,b) = 1$ and $gcd(b,c) = 1$.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
Also $c$ is a perfect square.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
We will call a right-angled triangle perfect if:
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
- it is a primitive right-angled triangle
|
|
|
|
- its hypotenuse is a perfect square
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
We will call a right-angled triangle super-perfect if:
|
|
|
|
|
|
|
|
- it is a perfect right-angled triangle
|
|
|
|
- its area is a multiple of the perfect numbers 6 and 28.
|
|
|
|
|
|
|
|
How many perfect right-angled triangles with $c ≤ {10}^{16}$ exist that are not super-perfect?
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
`perfectRightAngledTriangles()` should return `0`.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
2021-07-15 07:20:31 +00:00
|
|
|
assert.strictEqual(perfectRightAngledTriangles(), 0);
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
2021-07-15 07:20:31 +00:00
|
|
|
function perfectRightAngledTriangles() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-15 07:20:31 +00:00
|
|
|
perfectRightAngledTriangles();
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|