# Prime generating formulas

**URL:** <https://boards.straightdope.com/t/prime-generating-formulas/46655>\
**Category:** Factual Questions\
**Created:** [December 21, 2000, 5:22am UTC](https://boards.straightdope.com/t/prime-generating-formulas/46655 "2000-12-21T05:22:03Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![kabbes](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@kabbes](https://boards.straightdope.com/u/kabbes)\
**Post date:** [December 22, 2000, 11:13am UTC](https://boards.straightdope.com/t/prime-generating-formulas/46655/21 "2000-12-22T11:13:21Z")

</div>

> [@](#):
>
> \*Originally posted by Ben \*  
> I’m afraid I don’t know ring theory…
> 
> To phrase my question more specifically, is it known whether there are a finite number of n for which x^2 + x + n gives primes for all integer x such that 0\<=x\<n? Clearly we don’t know whether there are an infinite number, because the n that work are a subset of the set of twin primes. However, this leaves open the possibility that the number of n that work perfectly (ie no composite numbers in the appropriate range of x values) might have been proven to be finite.
> 
> \*\*

The thing is, the answer to this question is very much bound up in ring (and field) theory - I’m not sure that one can give a complete answer without it. Furthermore, unfortunately for me it’s been two years since I finished my degree and the specifics of the answer elude me anyway.

IIRC though the answer is all based around the discriminant of the ring that can be manufactured from the polynomial. Basically the discriminant is b^2 - 4ac where ax^2 + bx + c = 0. This ring is manufactured by recognising that sets of polynomials can themselves be formed into groups, rings or fields (see [here](http://www.math.umd.edu/comp/magma/htmlhelp/part5.html)for description of a ring) since they can be factorised into a basis that fits the properties of these constructs.

Anyhow, to cut a long story short the number of primes that will be generated from the polynomial is dependent on the properties of this ring, which in turn depends on its discriminant. Again, IIRC, once the discriminant gets too large (as a negative number) the ring starts being forced into properties which preclude such prime generation. Basically you can’t get better than x^2 +x + 41. So yes - there are a finite number of different n.

I’ve glossed over almost everything in that explanation - either because I can’t quickly explain it or because I can’t remember it. Hopefully a more practicing mathematician can provide a more easily digestible version, but I didn’t want to leave your question _completely_ unanswered. Also there is a possibility I have _not_ “RC”, in which case someone better contradict me quick!

pan

[Previous page](https://boards.straightdope.com/t/prime-generating-formulas/46655.md?page=1)
