feat(seed): Added more assertion for Project Euler problem twe (#15887)
This commit is contained in:
committed by
Quincy Larson
parent
ada67f8649
commit
739f1879a2
@ -842,17 +842,20 @@
|
||||
"type": "bonfire",
|
||||
"title": "Problem 27: Quadratic primes",
|
||||
"tests": [
|
||||
"assert.strictEqual(euler27(), -59231, 'message: <code>euler27()</code> should return -59231.');"
|
||||
"assert(quadraticPrimes(200) == -4925, 'message: <code>quadraticPrimes(200)</code> should return -4925.');",
|
||||
"assert(quadraticPrimes(500) == -18901, 'message: <code>quadraticPrimes(500)</code> should return -18901.');",
|
||||
"assert(quadraticPrimes(800) == -43835, 'message: <code>quadraticPrimes(800)</code> should return -43835.');",
|
||||
"assert(quadraticPrimes(1000) == -59231, 'message: <code>quadraticPrimes(1000)</code> should return -59231.');"
|
||||
],
|
||||
"solutions": [],
|
||||
"translations": {},
|
||||
"challengeSeed": [
|
||||
"function euler27() {",
|
||||
"function quadraticPrimes(range) {",
|
||||
" // Good luck!",
|
||||
" return true;",
|
||||
" return range;",
|
||||
"}",
|
||||
"",
|
||||
"euler27();"
|
||||
"quadraticPrimes(1000);"
|
||||
],
|
||||
"description": [
|
||||
"Euler discovered the remarkable quadratic formula:",
|
||||
@ -861,7 +864,7 @@
|
||||
"The incredible formula $n^2 - 79n + 1601$ was discovered, which produces 80 primes for the consecutive values $0 \\le n \\le 79$. The product of the coefficients, −79 and 1601, is −126479.",
|
||||
"Considering quadratics of the form:",
|
||||
"",
|
||||
"$n^2 + an + b$, where $|a| < 1000$ and $|b| \\le 1000$where $|n|$ is the modulus/absolute value of $n$e.g. $|11| = 11$ and $|-4| = 4$",
|
||||
"$n^2 + an + b$, where $|a| < range$ and $|b| \\le range$where $|n|$ is the modulus/absolute value of $n$e.g. $|11| = 11$ and $|-4| = 4$",
|
||||
"",
|
||||
"Find the product of the coefficients, $a$ and $b$, for the quadratic expression that produces the maximum number of primes for consecutive values of $n$, starting with $n = 0$."
|
||||
]
|
||||
|
Reference in New Issue
Block a user