If we assume that $p=2^{24036583}-1$ is the greatest prime number until now .How to find the number of the positive integer numbers $k$ that makes for the two quadratic equations $ \pm x^2 \pm px \pm k$ rational roots.


2 Answers 2


(Assuming that the question is rather about $x^2-px+k$ and $x^2-px-k$ simultaneously having rational [=integer] solutions)

Let $a,p-a$ be the roots of $x^2-px-k$ and $b,p-b$ the roots of $x^2-px+k$. Then $a(p-a)=k=-b(p-b)$, i.e., $$\tag1 a^2+b^2=p(a+b).$$ Unless $p\mid a,b$, this means that $x^2+1\equiv 0\pmod p$ has a solution. But for $p\equiv -1\pmod 4$, no such solution exists. We conclude $p\mid a$, $p\mid b$, say $a=pu,b=pv$. Then $(1)$ becomes $$\tag2u^2+v^2=u+v.$$ For $x\in\Bbb Z$ we have $x^2\ge x$ with equality iff $x\in\{0,1\}$. Thus we concolude from $(2)$ that $a,b\in\{0,p\}$. At any rate, this implies that the only possible value for $k$ si $k=a(p-a)=0$ (which is not positive).


$x^2+px+k=0$ will have rational (indeed, integer) roots if and only if $p^2-4k$ is a square, $p^2-4k=q^2$. Let's write this as $p^2-q^2=4k$. This works for every odd number $q$ less than $p$, so there are $(p-1)/2$ such numbers $k$.

I don't know what you mean by "the two quadratic equations." The equation $x^2+px+k=0$ is the same as $-x^2-px-q=0$. If you want to choose the signs independently, then you get four (pairs of inequivalent) equations, not two, but they can be handled by the same methods as the one I did.

  • $\begingroup$ Can you explain how did you know that there are $(p-1)/2$,please ? $\endgroup$
    – Frank
    Sep 28, 2012 at 10:20
  • $\begingroup$ @Mohammed, that's how many odd numbers there are less than $p$. $\endgroup$ Sep 28, 2012 at 13:19
  • $\begingroup$ How about $k$ ? $\endgroup$
    – Frank
    Sep 28, 2012 at 17:31
  • $\begingroup$ @Mohammed, $p^2-q^2=4k$ gives you a value of $k$ for every odd number $q$ less than $p$. There are $(p-1)/2$ odd numbers less than $p$. $\endgroup$ Sep 28, 2012 at 22:35
  • 2
    $\begingroup$ @GerryMyerson, I think the OP is really asking, in effect, for the number of positive integers $k$ for which both $x^2-px+k$ and $x^2-px-k$ have integer roots. The more recent question that you marked as a duplicate of this one states the question somewhat more clearly. If I'm correct, the sought-for answer is $0$ (i.e., there are no postive $k$ for which both quadratics have integer roots), ultimately because $p\equiv-1$ mod $4$. $\endgroup$ May 19, 2017 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.