56 lines
1.5 KiB
Markdown
56 lines
1.5 KiB
Markdown
|
---
|
||
|
id: 5900f4831000cf542c50ff95
|
||
|
challengeType: 5
|
||
|
title: 'Problem 278: Linear Combinations of Semiprimes'
|
||
|
videoUrl: ''
|
||
|
localeTitle: 'Problema 278: Combinações Lineares de Semiprimes'
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
<section id="description"> Dados os valores dos inteiros 1 <a1 <a2 <... <an, considere a combinação linear q1a1 + q2a2 + ... + qnan = b, usando apenas valores inteiros qk ≥ 0. <p> Note que para um dado conjunto de ak, pode ser que nem todos os valores de b sejam possíveis. Por exemplo, se a1 = 5 e a2 = 7, não há q1 ≥ 0 e q2 ≥ 0 tal que b poderia ser 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 ou 23 . </p><p> De fato, 23 é o maior valor impossível de b para a1 = 5 e a2 = 7. Portanto, chamamos f (5, 7) = 23. Similarmente, pode ser mostrado que f (6, 10, 15) = 29 e f (14, 22, 77) = 195. </p><p> Encontre ∑ f (p <em>q, p</em> r, q * r), onde p, q e r são números primos e p <q <r <5000. </p></section>
|
||
|
|
||
|
## Instructions
|
||
|
<section id="instructions">
|
||
|
</section>
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: <code>euler278()</code> deve retornar 1228215747273908500.
|
||
|
testString: 'assert.strictEqual(euler278(), 1228215747273908500, "<code>euler278()</code> should return 1228215747273908500.");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
function euler278() {
|
||
|
// Good luck!
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
euler278();
|
||
|
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|