Are there any polynomial functions that always have prime outputs for integer inputs? Analytic functions? [duplicate]

Integers of the form 2^(2^n) were conjectured by Pierre de Fermat to always be prime, however, he was proved wrong. Are there any analytic functions where his conjecture would be correct? That is, are there any analytic functions where integer inputs produce prime outputs? Using Mills' constant A, we can use floor(A^(3^n)) but this requires the floor function which is not analytic. Furthermore, if there are analytic functions with this property, are there any polynomial functions?


Solution 1:

See my comment and https://mathworld.wolfram.com/Prime-GeneratingPolynomial.html

It gives some good information about polynomials and rational functions, especially this beginning part:

"Legendre showed that there is no rational algebraic function which always gives primes. In 1752, Goldbach showed that no polynomial with integer coefficients can give a prime for all integer values (Nagell 1951, p. 65; Hardy and Wright 1979, pp. 18 and 22). However, there exists a polynomial in 10 variables with integer coefficients such that the set of primes equals the set of positive values of this polynomial obtained as the variables run through all nonnegative integers, although it is really a set of Diophantine equations in disguise (Ribenboim 1991). Jones, Sato, Wada, and Wiens have also found a polynomial of degree 25 in 26 variables whose positive values are exactly the prime numbers (Flannery and Flannery 2000, p. 51)."