How to demonstrate that there is no all-prime generating polynomial with rational cofficents? It seems like there is no polynomial with finite variables known, which could generate all prime numbers, by integer assignments. Is there a proof that such polynomial can not exist and does anyone have one in his/her stack?
 A: In fact there does not even exist a non-constant polynomial $f$ (I assume you want integer coefficients) which only takes prime values with integer inputs. It suffices to prove this for polynomials in one variable. By the hypothesis that $f$ is non-constant, it takes arbitrarily large values, so without loss of generality $|f(0)| > 1$; in particular, $f(0)$ is divisible by some prime $p$. Then $f(kp)$ is always divisible by $p$, hence cannot be prime for sufficiently large $k$. 
However, remarkably there do exist polynomials in more than one variable all of whose positive values are prime. 
A: Here, it is clear that by hand-picking values, it is clear that there is no all-prime generating polynomial. It is even possible to demonstrate that there are infinite composite values to the function as well.

First of all, we state that a polynomial with integer input, and integer coefficients will only give integer output. This is because any positive power (the exponent in the function) of an integer is also an integer, and an integer multiplied by an integer (coefficient) is also an integer.
We write a general polynomial function in the form: $$f(x)=a_mx^m+a_{m-1}x^{m-1}+\cdots+a_2x^2+a_1x^1+a_0x^0.$$
Note that it is allowed in this proof for individual values of $a$ to be $0$, even the $a_m$, but just that there must be at least one non-constant term!
Now, we let the arbitrary integer $n$ be of the form $ka_0$ where $k$ can be any integer. We substitute $x=ka_0$ into the polynomial form, which gives us: $$f(n)=f(ka_0)=a_m(ka_0)^m+a_{m-1}(ka_0)^{m-1}+\cdots+a_2(ka_0)^2+a_1(ka_0)^1+a_0(ka_0)^0.$$
Let's expand that:
$$f(ka_0)=a_mk^ma_0^m+a_{m-1}k^{m-1}a_0^{m-1}+\cdots+a^2k^2a_0^2+a^1k^1a_0^1+a_0k^0a_0^0.$$
We notice that every term in the new expression has a factor of $a_0$! This means that $a_0$ is a factor of the value of the polynomial output.
Here, we notice that we defined $k$ as any arbitrary integer, so we can set it to any value we want. This gives us infinite outputs for the function as composite numbers, since $k$ can be any desired integer. $\square$
A: Consider a polynomial $P(n)$ with integer coefficients;
also, assume that the constant term (coefficient of $n^{0}$), is $a_{0}$.
If $a_{0}\neq 1$, then, putting $n=c*a_{0}$, where c is a non-zero integer, shall yield a multiple of $a_{0}$.
In general, $P(cP(1)+1)$ shall always be divisible by $P(1)$. Hence, the given polynomial cannot generate only primes!!
