An interesting table of Prime Generating polynomials similar to $n^2+n+41$?

Here is some data on quadratic prime-generating polynomials of a particular form. Kindly look at the questions given below it. Note: The discriminant $d$ is square-free and its class number $h(d)$ is also given.

$$\begin{array}{|c|c|c|c|} \hline \text{#} & P(n)=an^2+bn+c & d = b^2-4ac & h(d) & Prime\; range &Total\,(T)\\ \hline \text{I}.\;a = b\\ 1& n^2+n+41 & \color{red}{-163}& 1&0 - 39&40\\ 2& n^2+n-35953 & 143813& 1& 172- 196& 25\\ 3& n^2+n-169933 & 679733& 1& 379- 403& 25\\ 4& n^2+n-200743 & 802973& 1& 429- 458& 30\\ 5& 2n^2+2n-23813 & 47627& 8& 89- 113& 25\\ 6& 3n^2+3n-199 & 2397& 2& 0- 22& 23\\ 7& 3n^2+3n-35597 & 427173& 3& 97- 124& 28\\ 8& 3n^2+3n-49807 & 597693& 2& 110- 137& 28\\ 9& 3n^2+3n-61169 & 734037& 2& 126- 152& 27\\ 10a& 4n^2+4n-(4d'-1) & d'=227& 1& 2- 26& 25\\ 10b& 4n^2+4n-(16d'-1) & d'=227& 1& 19- 39& 21\\ 11& 4n^2+4n-(d-1) & d=\color{blue}{398}& 1& 0- 26& 27\\ 12& 4n^2+4n-(4d-1) & d=\color{blue}{398}& 1& 1-35& \color{blue}{35}\\ 13& 4n^2+4n-(16d-1) & d=\color{blue}{398}& 1& 23-53& 31\\ 14& 6n^2+6n+31 & \color{red}{-177}& 4& 0-28& 29\\ 15& 7n^2+7n-43 & 1253& 1& 3-26& 24\\ 16& 7n^2+7n-44893 & 1257053& 3& 67-91& 25\\ 17& 8n^2+8n-(\tfrac{d}{2}-2) & d=\color{blue}{398}& 1& 0-30& 31\\ 18& 9n^2+9n-1147 & 4597& 3& 1-27& 27\\ 19& 9n^2+9n-1801 & 7213& 1& 0-23& 24\\ 20& 11n^2+11n-23993 & 1055813& 4& 34-65& 32\\ 21& 12n^2+12n-12041 & 9033& 1& 25-49& 25\\ 22& 16n^2+16n-8773 & 8777& 1& 5-29& 25\\ \hline \text{II.}\;b = 0\\ 1& 2n^2+29 & \color{red}{-58}& 2& 0-28& 29\\ 2& 4n^2-2273 & 2273 & 1& 8- 34& 27\\ 3& 4n^2-8153& 8153& 1& 32- 56& 27\\ 4& 4n^2-8777& 8777& 1& 33- 60& 27\\ 5& 12n^2-5419 & 16257& 5& 4- 33& 30\\ \hline \end{array}$$

I found these by making Mathematica look at $P(n)=an^2\pm bn \pm p_k$ such that $P(n)$ is prime for at least $24$ n. My search was a bit crude so it can be improved.

Questions: Let $P(n)$ be of these two types and range restricted to $n \ge 0$:

  1. Any other $P(n)$ with total range $T \ge 24$? (Mathworld missed #12 which is $P(n)=4n^2+4n-1591$ with $T=35$, so I assume there are more.)
  2. Is there one with $T>40$?
  3. Why does the real quadratic field with $d=398$ appear often?
  4. Can a $P(n)$ have two prime ranges that are relatively long?

$\color{green}{Update}$:

Regarding question 4. Turns out $P(n)=4n^2+4n+397$ is prime for ranges $n=0-26$ and $n=122-137$. I also checked $P(n)=n^2+n+41$ and found that the only other long range is $n=219-231$.


Solution 1:

I have found a significant number of polynomials of this type with $T\ge 24$ but nothing with $T>40$.

The prime $k$-tuples conjecture suggests that there should be examples with $T$ arbitrarily large since $2n^2$ and $n^2+n$ omit some residue classes for every prime. For example, for $n=0,1,\ldots,9$ the differences $n^2+n-(0^2+0)$ are $(0,2,6,12,20,30,42,56,72,90)$ which forms an admissible 10-tuple of differences for primes. So we may expect there are infinitely many sets of primes with these differences, for example there are starting at,

$$11,17,41,844427,51448361,86966771,122983031,180078317$$

(Edit: See A191456.) So to generate these polynomials with $T\ge 10$ we can just look for these, e.g. $n^2+n+41$, $n^2+n+51448361$ and $n^2+n+180078317$ all work, the first and last have $T>10$. Similarly the differences for $n=0,1,\ldots,39$ form an admissible 40-tuple so there should be larger primes $q$ such that $n^2+n+q$ has $T\ge 40$, but they will be tough to find with brute force.

Here are some with $T\ge 27$. Here $\operatorname{sqfr}(d)$ is the square-free part of the discriminant. $$ \begin{array}{|cccccc|} \hline Type & P(n) & T & \operatorname{sqfr}(d) & h(d) \\ \hline I & n^2+n-1354363 & 29 & \color{blue}{5417453} & 4 \\ I & 2(n^2+n)-177953 & 27 & 355907 & 2 \\ I & 3(n^2+n)-675299 & 34 & 8103597 & 6 \\ I & 3(n^2+n)-122957 & 30 & 1475493 & 2 \\ I & 5(n^2+n)-65063 & 27 & 1301285 & 4 \\ I & 5(n^2+n)-611903 & 27 & 12238085 & 4 \\ I & 5(n^2+n-6)\color{green}{-281837} & 27 & \color{green}{5637365} & 2 \\ I & 9(n^2+n)-90071 & 27 & 360293 & 1 \\ I & 9(n^2+n)-867551 & 27 & 3470213 & 3 \\ I & 11(n^2+n)-258113 & 27 & 11357093 & 1 \\ I & 12(n^2+n)-236111 & 27 & 708342 & 4 \\ I & 15(n^2+n)-157147 & 27 & 9429045 & 8 \\ I & 22(n^2+n)-330271 & 28 & 7266083 & 8 \\ I & 22(n^2+n)-10273 & 28 & 226127 & 4 \\ I & 35(n^2+n)+6283 & 24 & -878395 & 92 \\ I & 38(n^2+n)-9287 & 34 & 353267 & 4 \\ I & 41(n^2+n)-33023 & 29 & \color{blue}{5417453} & 4 \\ I & 45(n^2+n)-1322611 & 29 & 26452445 & 2 \\ I & 125(n^2+n)\color{green}{-281837} & 27 & \color{green}{5637365} & 2 \\ I & 175(n^2+n)-333103 & 28 & 9328109 & 1 \\ I & 210(n^2+n) - 71899 & 29 & 15109815 & 32 \\ \hline II & 2n^2-181 & 28 & 362 & 2 \\ II & 6n^2-140897 & 33 & 845382 & 6 \\ II & 14n^2-85093 & 28 & 1191302 & 2 \\ II & 22n^2-20051 & 27 & 441122 & 2 \\ II & 30n^2-176399 & 27 & 5291970 & 8 \\ II & 38n^2-856759 & 28 & 32556842 & 2 \\ II & 42n^2-153779 & 28 & 6458718 & 8 \\ II & 258n^2+3331 & 27 & -859398 & 240 \\ \hline \end{array} $$

$n^2+n-1354363$ also has another run of 18 primes and $14n^2-85093$ another run of 17.

As per the request in the comments, here are a few more pairs of polynomials with matching $\operatorname{sqfr}(d)$ (one is repeated from above). $$ \begin{array}{|cccc|} \hline P(n) & T & \operatorname{sqfr}(d) & h(d) \\ \hline 3(n^2+n-2)-58111 & 20 & 697413 & 4 \\ 3^3(n^2+n)-58111 & 20 & 697413 & 4 \\ \hline 3(n^2+n-2)-92893 & 20 & 1114797 & 2 \\ 3^3(n^2+n)-92893 & 18 & 1114797 & 2 \\ \hline 3(n^2+n-2)-1070633 & 16 & 12847677 & 2 \\ 3^3(n^2+n)-1070633 & 18 & 12847677 & 2 \\ \hline 5(n^2+n-6)-281837 & 27 & 5637365 & 2 \\ 5^3(n^2+n)-281837 & 27 & 5637365 & 2 \\ \hline 5(n^2+n-6)-1076687 & 13 & 21534365 & 12 \\ 5^3(n^2+n)-1076687 & 19 & 21534365 & 12 \\ \hline 7(n^2+n-12)-112417 & 18 & 3150077 & 1 \\ 7^3(n^2+n)-112417 & 18 & 3150077 & 1 \\ \hline 7(n^2+n-12)-214519 & 18 & 6008933 & 14 \\ 7^3(n^2+n)-214519 & 16 & 6008933 & 14\\ \hline \end{array} $$