0%

Problem 27


Problem 27


Quadratic primes

Euler discovered the remarkable quadratic formula:

$$n^2 + n + 41$$

It turns out that the formula will produce $40$ primes for the consecutive integer values $0 \le n \le 39$. However, when $n = 40$, $40^2 + 40 + 41 = 40(40 + 1) + 41$ is divisible by $41$, and certainly when $n = 41$, $41^2 + 41 + 41$ is clearly divisible by $41$.

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$.

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$.


素数生成二次多项式

欧拉发现了这个著名的二次多项式:

$$n^2 + n + 41$$

对$0\le n\le39$范围内的所有整数,这个多项式可以连续生成$40$个质数。但是,当$n=40$时,$40^2 + 40 + 41 = 40(40 + 1) + 41$能够被$41$整除,而当$n=41$时,$41^2 + 41 + 41$显然也能够被$41$整除。

之后,人们又发现了一个神奇的多项式$n^2 - 79n + 1601$,这个多项式能够对$0\le n\le79$范围内的所有整数连续生成$80$个质数。这个二次多项式的系数分别是$-79$和$1601$,其乘积为$-126479$。

考虑所有如下形式的二次多项式:
$n^2 + an + b$,其中$|a|<1000$,$|b| \le 1000$。

这里$|n|$表示$n$的绝对值,例如,$|11| = 11$,$|-4| = 4$。

找出其中能够从$n=0$开始连续生成最多素数的二次多项式,求其系数$a$和$b$的乘积。