# Find the pairs $(m,k)$ solving the diophantine equation $m^2=7k+9$

Solve

$$m^2=7k+9$$

over the integers

First i rearrange got $$m^2-9=7k$$ And $$(m^2-9)/7=k$$ So first $$m^2-9$$ must be divisible by $$7$$

So suppose $$m=7n , 7n+1 ,...,7n+5$$ But it doesn't work ....

• So what you're looking at is $$m^2 \equiv 2 {\mod 7}$$ I would suggest plugging in some values for $m$ and seeing what happens. $m=1, 2, 3, 4, 5, 6, 7 \ldots$. If you find a solution $m_0$,then $m_0 \pm 7$ is also a solution. Therefore, you only need to look at the first $7$ integers. – Matti P. Jan 11 at 12:57
• Hint: $m^2-9=(m-3)(m+3)$, so $7\mid m^2-9\iff7\mid m-3\lor7\mid m+3$, since $7$ is prime. – Barry Cipra Jan 11 at 14:57
• If $(m_0,k_0)$ is a solution, then $(m_0+7, k_0+2m_0+7)$ is also a solution $$m_0^2=7k_0+9 \iff m_0^2+14m_0+49=7k_0+9+14m_0+49=7(k_0+2m_0+7)+9 \iff\\ (m_0+7)^2=7(k_0+2m_0+7)+9$$ and start with $(3,0)$. – rtybase Jan 11 at 17:49

$$m^2=7k+9 \Rightarrow m^2=2 \;(\mod 7)$$.

The only numbers from 1 to 7 satisfying the equation are 3 and 4 ($$3^2=9=2; 4^2=16=2$$. Then, the solution is of the form:

$$m\in\{3+7n, 4+7n, n \in \mathbb{N}\}$$; and $$k=\frac{m^2-9}{7}$$

For instance, if $$m=81=4+77$$, then $$k=936$$, and

$$81^2=7 \cdot 936 + 9$$

Above equation $$m^2=7k+9$$ has solution's,

$$m=7w-4$$

$$k=(7w-1)(w-1)$$, where, 'w' is any integer

For $$w=2$$ we get, $$(m.k)=(10,13)$$

$$(10)^2=7(13)+9$$

• What about (3,0)? – pendermath Jan 11 at 17:27
• It is included $w=1$ – Mike Jan 11 at 18:31
• Sorry, I meant (4,1) – pendermath Jan 11 at 21:04
• For w=0, you will get (m,k)=(4,1) – Sam Jan 11 at 22:10
• If $w=0$, then $m=-4$, not 4, right? – pendermath Jan 12 at 22:37

As you said $$7$$ must divide $$m^2-9=(m-3)(m+3)$$. Since $$7$$ is prime, it must divide either $$m-3$$ or $$m+3$$.

Therefore, you have two sets of solutions:

Case 1: $$7|m-3$$ then $$m-3=7l \\ m=7l+3 \\ 7k+9=m^2=49l^2+42l+9 \\ k=7l^2+6l\\ (k,m)= ( 7l^2+6l, 7l+3)$$

Case 2: $$7|m+3$$ then $$m+3=7l \\ m=7l-3 \\ 7k+9=m^2=49l^2-42l+9 \\ k=7l^2+6l\\ (k,m)= ( 7l^2-6l, 7l-3)$$