56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
---
|
||
id: 5900f4831000cf542c50ff95
|
||
challengeType: 5
|
||
title: 'Problem 278: Linear Combinations of Semiprimes'
|
||
videoUrl: ''
|
||
localeTitle: 问题278:半正定的线性组合
|
||
---
|
||
|
||
## Description
|
||
<section id="description">给定整数1 <a1 <a2 <... <an的值,考虑线性组合q1a1 + q2a2 + ... + qnan = b,仅使用整数值qk≥0。 <p>注意,对于给定的ak集合,可能不是b的所有值都是可能的。例如,如果a1 = 5且a2 = 7,则没有q1≥0且q2≥0使得b可以是1,2,3,4,6,8,9,11,13,16,18或23 。 </p><p>事实上,23是a1 = 5和a2 = 7的b的最大不可能值。因此,我们称f(5,7)= 23.同样,可以证明f(6,10,15)= 29和f(14,22,77)= 195。 </p><p>找到Σf(p <em>q,p</em> r,q * r),其中p,q和r是素数,p <q <r <5000。 </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>euler278()</code>应该返回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>
|