Ulam spiral: Is there an "unusual amount of clumping" in prime-rich quadratic polynomials?

Solution 1:

You will find this paper of interest:

Fung and Williams, "Quadratic polynomials which have a high density of prime values", Mathematics of Computation, 55:191, July 1990, 345-353.

Solution 2:

It is easy to check numerically. For $x^2-x+41$ I found the following values:

x $\leq$ - number of primes - number of expected primes - ratio

$1000000 - 261082 - 39313 - 6.64$

$5000000 - 1157818 - 174318 - 6.64$

For $x^2-x+43$ :

$1000000 - 49233 - 39313 - 1.25$

$5000000 - 219098 - 174318 - 1.25$

For $x^2-x+45$ :

$1000000 - 32060 - 39313 - 0.81$ $ 5000000 - 141501 - 174318 - 0.81$

For the expected number of primes I summed up the probabilities that a number x (that is choosen randomly) is prime, $\frac{1}{ln(x)}$. Not only are there much more primes in $x^2-x+41$ than the other two polynomials, the ratio as I calculated it looks like it's converging. Withoug having read the whole paper Matthew Conroy linked, I'm pretty sure that the ratios are in fact the Hardy-Littlewood constants.

Edit: I see what you mean now. I'm trying to find a mathematical definition of "clumping", but it is all somewhat vage...

Edit2: Perhaps this is an approach: We start small with the number of expected "twinprimes", which in our case means $f(x)=x²-x+41$ is prime for consecutive integers. The probability should be about $\sum \frac{6.64^2}{\ln{f(x)}\ln{f(x+1)}}$. The $6.64$ is due to the fact that our polynomial has about that much more primes than normally expected.

$1000000 - 69152 - 68885 - 1.003870966737562$

$2000000 - 124384 - 123599 - 1.0063466049598313$

$3000000 - 175873 - 174474 - 1.008017081247298$

$4000000 - 225335 - 223075 - 1.0101310763434574$

$5,000,000 - 273080 - 270083 - 1.011093447429278$

It is pretty close to what I expected. Perhaps you need to look at bigger clumps to see a big difference.

$100,000,000 - 3723447 - 3678470 - 1.0122270933045168$

$200,000,000 - 6877502 - 6797647 - 1.0117473483885233$

Solution 3:

Clumps of primes from such quadratic equations should behave similarly to variations in the gaps between all primes. In general, richer functions in primes are more likely to find groups. There are other quadratics that generate streaks of consecutive outputs that are prime, such as:

2n^2 - 272431: Prime for n = 371 to 393 (23 in a row) 2n^2 + 144251: Two streaks, n = 34 to 50 (17) and n = 583 to 602 (20). n(n+1) - 1776433: Prime for n = 1424 to 1443 (20); my JVM has calculated the prime density of this one at about 8.32 (versus Euler's ~6.64). Its smallest dividing primes are 41, 59, 97, and 101. It's nowhere near the records for the richest functions, though.