2018-09-30 22:01:58 +00:00
---
id: 5900f4831000cf542c50ff95
challengeType: 5
title: 'Problem 278: Linear Combinations of Semiprimes'
2019-08-05 16:17:33 +00:00
forumTopicId: 301928
2018-09-30 22:01:58 +00:00
---
## Description
< section id = 'description' >
2018-10-08 00:01:53 +00:00
Given the values of integers 1 < a1 < a2 < . . . < an , consider the linear combinationq1a1 + q2a2 + . . . + qnan = b, using only integer values qk ≥ 0 .
2018-09-30 22:01:58 +00:00
Note that for a given set of ak, it may be that not all values of b are possible.
2018-10-08 00:01:53 +00:00
For instance, if a1 = 5 and a2 = 7, there are no q1 ≥ 0 and q2 ≥ 0 such that b could be
2018-09-30 22:01:58 +00:00
1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23.
In fact, 23 is the largest impossible value of b for a1 = 5 and a2 = 7. We therefore call f(5, 7) = 23. Similarly, it can be shown that f(6, 10, 15)=29 and f(14, 22, 77) = 195.
Find ∑ f(p*q,p*r,q*r), where p, q and r are prime numbers and p < q < r < 5000 .
< / section >
## Instructions
< section id = 'instructions' >
< / section >
## Tests
< section id = 'tests' >
```yml
2018-10-04 13:37:37 +00:00
tests:
- text: < code > euler278()</ code > should return 1228215747273908500.
2019-07-27 02:30:17 +00:00
testString: assert.strictEqual(euler278(), 1228215747273908500);
2018-09-30 22:01:58 +00:00
```
< / 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
```
2019-07-18 15:24:12 +00:00
2018-09-30 22:01:58 +00:00
< / section >