69 lines
1.3 KiB
Markdown
69 lines
1.3 KiB
Markdown
![]() |
---
|
|||
|
id: 5
|
|||
|
localeTitle: 5900f3ec1000cf542c50fefe
|
|||
|
challengeType: 5
|
|||
|
title: 'Problem 127: abc-hits'
|
|||
|
---
|
|||
|
|
|||
|
## Description
|
|||
|
<section id='description'>
|
|||
|
El radical de n, rad (n), es el producto de distintos factores primos de n. Por ejemplo, 504 = 23 × 32 × 7, entonces rad (504) = 2 × 3 × 7 = 42.
|
|||
|
Definiremos el triplete de enteros positivos (a, b, c) como un acierto si:
|
|||
|
GCD (a, b) = GCD (a, c) = GCD (b, c) = 1
|
|||
|
a <b
|
|||
|
a + b = c
|
|||
|
rad (abc) <c
|
|||
|
Por ejemplo, (5, 27, 32) es un éxito abc, porque:
|
|||
|
GCD (5, 27) = GCD (5, 32) = GCD (27, 32) = 1
|
|||
|
5 <27
|
|||
|
5 + 27 = 32
|
|||
|
rad (4320) = 30 <32
|
|||
|
Resulta que los abc-hits son bastante raros y solo hay treinta y uno abc-hits para c <1000, con ∑c = 12523.
|
|||
|
Encuentra ∑c para c <120000.
|
|||
|
</section>
|
|||
|
|
|||
|
## Instructions
|
|||
|
<section id='instructions'>
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Tests
|
|||
|
<section id='tests'>
|
|||
|
|
|||
|
```yml
|
|||
|
tests:
|
|||
|
- text: <code>euler127()</code> debe devolver 18407904.
|
|||
|
testString: 'assert.strictEqual(euler127(), 18407904, "<code>euler127()</code> should return 18407904.");'
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Challenge Seed
|
|||
|
<section id='challengeSeed'>
|
|||
|
|
|||
|
<div id='js-seed'>
|
|||
|
|
|||
|
```js
|
|||
|
function euler127() {
|
|||
|
// Good luck!
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
euler127();
|
|||
|
```
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Solution
|
|||
|
<section id='solution'>
|
|||
|
|
|||
|
```js
|
|||
|
// solution required
|
|||
|
```
|
|||
|
</section>
|