-1

I have a quadratic function in $n$, $f(n)$. I want to find out the smallest positive $n$ for which $f(n)$ is composite. Outside of exhaustive search, is there a way to solve this?

Example: $f(n) = n^2 + n + 17$

Preferably, please just provide a hint to point me in the right direction instead of working out the example.

  • 1
    This is too vague. There's no universal method...we need to know more about the function. – lulu Jul 17 '20 at 14:34
  • Voting to close the question as it is too broad. Please edit your post to add detail. – lulu Jul 17 '20 at 14:48
  • Added an example – Souverain Premier Jul 17 '20 at 14:54
  • What is the broad class of functions you are interested in? Only quadratics? [edit] again to tell us a lot more about the question. – Ethan Bolker Jul 17 '20 at 14:57
  • 1
    For the given example, we can see that $f(17)$ is composite so you only have to search for $n\in {0,1,\cdots, 16}$. – lulu Jul 17 '20 at 14:58
  • @EthanBolker. Edited – Souverain Premier Jul 17 '20 at 15:18
  • @lulu. I don't think your vote makes sense. This is an elementary problem in number theory. I initially did not want to give an example because I want to solve it myself. All I am looking for is a hint or if there is none, indicate as much so I don't waste time looking for a solution that does not exist. To downvote it even after I gave a concrete example makes no sense. Anyway, downvote to your hearts content. – Souverain Premier Jul 18 '20 at 15:11
  • The downvote preceded your example. Post example, I provided a simple means of solution. – lulu Jul 18 '20 at 15:14
  • I have retracted the downvote, though I still think it is a poor question. The example did improve it. As I and others have remarked, there is no general method for solving problems of this type. If you intended to restrict only to the quadratic in your example, that's a very different question. – lulu Jul 18 '20 at 15:16
  • This polynomial is an instance of Euler's prime producing polynomials. $\ \ $ – Bill Dubuque Jan 25 '25 at 18:42

1 Answers1

1

I don't think there is a general method, but brute force is not likely to be slow. $f$ evaluated at its constant term is clearly composite. The first composite occurs no later than the smallest factor of the constant term.

You can speed up a brute force search since the successive values of a quadratic function are in arithmetic progression, so can be found with addition rather than multiplication.

Edit in response to comment.

If $f$ has constant term $1$ then look for composite values for $g$, where $$ g(x) = f(x+1). $$

Ethan Bolker
  • 103,433