# The Prime Polynomial: Generating Prime Numbers

First of all, i'll admit i'm no mathematics nerd. I'm from Stackoverflow, yet this inquiry appeared extra proper below, so i determined to ask you individuals

Now, i recognize noone has actually uncovered (or ever before will certainly) a Polynomial that creates Prime Numbers. Yet i've reviewed Curve Fitting (or Polynomial Fitting) so i was asking yourself if there was a means, we can have a straightforward n - level Polynomial that can create the first 1000 (or X) tops properly.

I do not require it to create all the tops, possibly simply upto 1 million, given that we currently have the information, can we reason that polynomial?

Just how large will be the polynomial for it to be exact? Could you offer an instance for the first 100 tops? Am i simply simple ignorant?

Many thanks beforehand.

0
2019-05-19 00:07:42
Source Share

While Robin was commenting, I prepared a Mathematica one - lining which offers you the Lagrange interpolation polynomial for the first n tops:

f[n_] := Sum[Prime[k] Product[x-m,{m,Join[Range[1,k-1], Range[k+1,n]]}] / Product[k-m,{m,Join[Range[1,k-1], Range[k+1,n]]}] ,{k,1,n}] // Expand


And I do not assume any person would certainly call the outcomes "straightforward". For n = 100 it is also large to paste below, yet n = 15 offers

4748 - (1752758563 *x)/ 120120+(71043957851 *x ^ 2)/ 3783780 - (4320411427 *x ^ 3)/ 316800+(378496362427 *x ^ 4)/ 59875200 - (7239131749 *x ^ 5)/ 3628800+(11528263 *x ^ 6)/ 25920 - (2075348983 *x ^ 7)/ 29030400+(5090997277 *x ^ 8)/ 609638400 - (977071 *x ^ 9)/ 1382400+(743507 *x ^ 10)/ 17418240 - (568871 *x ^ 11)/ 319334400+(2207 *x ^ 12)/ 45619200 - (3151 *x ^ 13)/ 4151347200+(89 *x ^ 14)/ 17435658240

0
2019-05-21 11:57:37
Source

From Mathworld

However, there exists a polynomial in 10 variables with integer coefficients such that the set of tops amounts to the set of favorable values of this polynomial gotten as the variables go through all nonnegative integers, although it is actually a set of Diophantine formulas in camouflage (Ribenboim 1991). Jones, Sato, Wada, and also Wiens have actually additionally located a polynomial of level 25 in 26 variables whose favorable values are specifically the prime numbers (Flannery and also Flannery 2000, p. 51).

However, the tops do not appear in order, so this will certainly not aid wherefore you desire. Yet it is intriguing.

0
2019-05-21 11:22:23
Source