0
$\begingroup$

Let $f(x)=ax^2+bx+c$ and $f(x)=n$. Is there an algorithm to choose $a,b,c$ such that the discriminant is minimized? Where $a,b,c,n,x$ are all integers.

More concretely, is there an algorithm to find $a,b,c$ in $f(x)=ax^2+bx+c=n$ such that:

  1. $a,c > 0$
  2. $|x| > 1$
  3. $\gcd(a,b,c)=1$
  4. $d=\min\{|b^2-4ac|\}$ where d is the discriminant of $f$.
$\endgroup$
11
  • $\begingroup$ Take $a=c=0$, $b=1$, then $d=1$, and every $n$ is represented. $\endgroup$ Commented Jan 16 at 10:39
  • $\begingroup$ @GerryMyerson I mean, sure, but then $f(x)$ is not a degree 2 polynomial....the underlying assumption being that $a\not=0$. The discriminant of a degree $1$ polynomial is not all that interesting. $\endgroup$ Commented Jan 16 at 12:17
  • 1
    $\begingroup$ $a = n - 1$, $c = 0$, $b = 1$. Then $x = 1$, $d = 1$. $\endgroup$ Commented Jan 16 at 12:35
  • 1
    $\begingroup$ @DenisShatrov Thank you. I just realized I missed some conditions. I have updated the question appropriately. $\endgroup$ Commented Jan 16 at 13:21
  • $\begingroup$ I'm afraid you still haven't ruled out some answers you won't like. $f(x)=nx^2+2nx+n$ has $f(0)=n$ and discriminant $(2n)^2-4nn=0$. $\endgroup$ Commented Jan 17 at 6:20

1 Answer 1

-1
$\begingroup$

Given $n$, we wish to find $a,b,c,x$ such that $a,b,c$ satisfy the given conditions, $b^2-4ac=1$, and $ax^2+bx+c=n$.

Given $a,b,c$, for $ax^2+bx+c=n$ to have an integer solution we need $b^2-4a(c-n)$ to be a square. This is $b^2-4ac+4an$. Now assume $b^2-4ac=1$. Then we want $1+4an$ to be a square. Since $1$ is a quadratic residue modulo $4n$, this can always be achieved; for any $n$, we can find $a,r$ such that $1+4an=r^2$.

Now we have $a$, but we still need $b^2-4ac=1$, that is, we need $1+4ac$ to be a square. But $1$ is a quadratic residue modulo $4a$, so we can find $c$ such that $1+4ac=b^2$ for some $b$. We now have $a,b,c$ such that $b^2-4ac=1$, and $ax^2+bx+c=n$.

Only, I'm not seeing how we know $x$ is an integer. It follows from the above that it's rational, and when I did the calculations for $n=1000$ it gave me $x=3$, but just at the moment I don't see the justification for asserting that $x$ is guaranteed to be an integer, not just a rational. So, consider this to be work-in-progress.

$\endgroup$
5
  • $\begingroup$ Simply $a=n+1$, $b=-2n-1$, $c=n$ and $x=0$ does the trick. $\endgroup$ Commented Jan 20 at 8:58
  • $\begingroup$ @Joachim, yes, that's similar to the comment Denis Shatrov left a few days ago, then OP indicated that he meant to rule out such answers. But if $n$ is prime, then my construction only leads to quadratics with leading coefficient $n\pm1$. $\endgroup$ Commented Jan 20 at 10:17
  • $\begingroup$ I see (although the above still doesn't seem to be ruled out in the current wording). I guess there are just too many degrees of freedom allowed in order to make this an interesting problem. $\endgroup$ Commented Jan 20 at 10:48
  • $\begingroup$ @JoachimKönig Thank you for the input. I think, requiring, $|x|>1$ solves this trivial answer. $\endgroup$ Commented Jan 20 at 15:07
  • $\begingroup$ But you can just substitute, say, $x-2$ for $x$, and get a quadratic with the same discriminant, but with $f(2)=n$. The substitution doesn't affect the leading coefficient, $a$, which will still be $n+1$. $\endgroup$ Commented Jan 20 at 20:57

You must log in to answer this question.