# How many solutions in the positive integers does the equation $x^2-y^2=4k$ have?

How many solutions in the positive integers does the equation $x^2-y^2=4k$ have, given that $k$ is an odd integer?

I want to say the answer is none, because $4(2k+1)$ is an even times an odd, and the different parity means we cannot find an integer solution to the difference of squares. Is this the right thinking? Thank you!

• If you require that $x,y$ be odd then there are no solutions...the left hand will always be divisible by $8$. But if one of them is $2m$ for odd $m$ and the other is divisible by $4$ then you get a solution. – lulu Oct 19 '16 at 0:20

$(4w)^2-2^2=16w^2-4=4(4w^2-1)$ So there are clearly an infinite number of solutions.

• This works provided $k$ is of the form $4w^2-1.$ [not sure if OP wants a restriction like that on $k$...] – coffeemath Oct 19 '16 at 0:18
• why not? He never said anything which might discredit this solution – Jorge Fernández Hidalgo Oct 19 '16 at 0:22
• Jorge-- Point taken. – coffeemath Oct 19 '16 at 0:23
• Jorge: there's also $(k+1)^2-(k-1)^2=4k$ without much restriction on $k$ But IMO your answer is already sufficient to show infinitely many $k$ have a solution $x,y$ to $x^2-y^2=4k.$ [And +1] – coffeemath Oct 19 '16 at 0:28

$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{x^{2} - y^{2} = 4k.\quad}$ $\ds{k}$ is an $\underline{odd\ integer}$. $\ds{\quad x, y\ \mbox{are integers}.\quad x, y:\ ?}$.

\begin{align} \mbox{Lets}\quad & \left.\begin{array}{rcl} \ds{x} & \ds{=} & \ds{u + v} \\ \ds{y} & \ds{=} & \ds{u - v} \end{array}\right\} \quad\iff\quad \left\{\begin{array}{rcl} \ds{u} & \ds{=} & \ds{x + y \over 2} \\[2mm] \ds{v} & \ds{=} & \ds{x - y \over 2} \end{array}\right.\,,\qquad \mbox{Then,}\quad \bbx{\ds{uv = k}} \end{align}

1. $\ds{\large k\ \underline{is\ prime}}$.

In that case we can take $\ds{u = k}$ and $\ds{v = 1 \implies x = k + 1\ \mbox{and}\ y = k - 1}$. For example: with $\ds{k = 17}$, $$18^{2} - 16^{2} = 324 - 256 = 68 = 4\times 17$$
2. $\ds{\large k\ \underline{is\ NOT\ prime}}$.

There is, at least, some integer $\ds{\pars{~n\ \mid\ 1 < n < k~}}$ where $\ds{k/n}$ is an integer. We can take $\ds{u = \max\braces{k/n,n}}$ and $\ds{v = k/u}$. For example, with $\ds{k = 81}$ we can take $\ds{u = 27}$ and $\ds{v = 3}$ such that $\ds{x = 30}$ and $\ds{y = 24}$: $$30^{2} - 24^{2} = 900 - 576 = 324 = 4 \times 81$$
$$\bbx{\quad% \mbox{The above discussion shows that there is always, at least, one solution for the original}\quad \\ \quad\mbox{question. In addition, our answer shows a systematic procedure to find a pair}\ \ds{\pars{x,y}}.}$$