1.7 KiB
1.7 KiB
id | challengeType | videoUrl | localeTitle |
---|---|---|---|
5900f3871000cf542c50fe9a | 5 | 问题27:二次素数 |
Description
$ n ^ 2 + an + b $,其中$ | a | <range $和$ | b | \ le $ $其中$ | n | $是$ n $的模数/绝对值,例如$ | 11 | = 11 $和$ | -4 | = 4 $
找到系数的乘积,$ a $和$ b $,用于生成连续值$ n $的最大素数数的二次表达式,从$ n = 0 $开始。
Instructions
Tests
tests:
- text: <code>quadraticPrimes(200)</code>应返回-4925。
testString: assert(quadraticPrimes(200) == -4925);
- text: <code>quadraticPrimes(500)</code>应返回-18901。
testString: assert(quadraticPrimes(500) == -18901);
- text: <code>quadraticPrimes(800)</code>应返回-43835。
testString: assert(quadraticPrimes(800) == -43835);
- text: <code>quadraticPrimes(1000)</code>应返回-59231。
testString: assert(quadraticPrimes(1000) == -59231);
Challenge Seed
function quadraticPrimes(range) {
// Good luck!
return range;
}
quadraticPrimes(1000);
Solution
// solution required
/section>