This question is an offshoot of this earlier one.

Allow me to state my question in full:

Is it possible to derive $m < p^k$ from the Diophantine equation $m^2 - p^k = 4z$ unconditionally, where $z \in \mathbb{N}$ and $p$ is a prime satisfying $p \equiv k \equiv 1 \pmod 4$, when it is solvable? (Note that I am only considering those $p$ and $m$ for which $\gcd(p,m)=1$.)

In the OP's attempt to solve the equation $m^2 - p^k = 4$, it is shown that $$p=5, k=1, m=3,$$ from which we have $$3 = m < p^k = 5^1 = 5.$$

Additionally, in a comment, the OP solves the equation $m^2 - p^k = 64$ and shows that $$p=17, k=1, m=9,$$ from which we get $$9 = m < p^k = {17}^1 = 17.$$

The accepted answer considers the equation $$m^2 - p^k = 2^{2n+2}.$$ MSE user mathlove gave the solution $$p=2^{n+2} + 1, k=1, m=2^{n+1} + 1,$$ provided $2^{n+2} + 1$ is prime.

Note that mathlove's solution gives $$2^{n+1} + 1 = m < p^k = \bigg(2^{n+2} + 1\bigg)^{1} = 2^{n+2} + 1.$$


I tried adding $p^k - m$ to both sides of $$m^2 - p^k = 4z,$$ but that did not really get me anywhere.


(This was added in response to a comment from MSE user Servaes.) I would like to specify that I am considering the divisibility constraint $\gcd(p,m)=1$ to hold.

  • 1
    $\begingroup$ I don't understand; simply plugging in $m=p^k$ yields $$z=\frac{m^2-p^k}{4}=\frac{p^{2k}-p^k}{4}=p^k\frac{p^k-1}{4},$$ which is an integer as $p\equiv1\pmod{4}$. So the equation is solvable for every choice of $p$ and $k$ with $p\equiv k\equiv 1\pmod{4}$, and there always exists a solution $m$ with $m\geq p^k$. $\endgroup$
    – Servaes
    Feb 21, 2020 at 14:13
  • $\begingroup$ @Servaes, thank you for your comment and attention. As you can see, the examples for $z=1$ and $z=16$ clearly indicate that $m < p^k$ is possible. Would you mind fleshing out your last comment as an actual answer (and include additional details, as needs be)? $\endgroup$ Feb 21, 2020 at 14:18
  • 1
    $\begingroup$ It is not clear to me what the question is. Which variables are given and which are to be solved for? And do you want to show that there exist solutions with $m<p$, or that all solutions have $m<p$? $\endgroup$
    – Servaes
    Feb 21, 2020 at 14:39
  • 1
    $\begingroup$ The latter is impossible; if $(p,k,m)$ is a solution for some $z_0$, then $(p,k,m+4p^k)$ is a solution for $z=z_0+2p^k(m+2p^{2k})$, where of course $\gcd(p,m+4p^k)=\gcd(p,m)=1$ and $m+4p^k>p^k$ if we take $m$ positive. $\endgroup$
    – Servaes
    Feb 21, 2020 at 14:47
  • 1
    $\begingroup$ More simply put; for any odd $m$ you have $m^2-p^k=4z$ for some integer $z$, so in fact $m$ can be arbitrarily large compared to $p^k$. $\endgroup$
    – Servaes
    Feb 21, 2020 at 14:50

1 Answer 1


No, the existence of solution to


is not enough to say that $m<p^k$. Take as a counterexample $m=9$, $p=5$, $k=1$, and $z=19$. Then

$$9^2-5^1=81-5=76=4\cdot 19$$

Of course, there may be a solution to $z=19$ such that $m<p^k$, but it requires more work to prove that this would always be the case for all $z$ where a solution exists.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .