# Diophantine equation $4x^2+n(n+1)x=y^2$ for a given $n>2$.

I want to show that the equation $$4x^2+n(n+1)x=y^2$$ has always solutions for a given $n>2$. I made the left hand side a square by adding $(n(n+1)/4)^2$ to both sides and get some Pythagorean triple.

Another way which I could see is after moving $y^2$ to the left hand side and using discriminant $\Delta=(n(n+1))^2+(4y)^2$ and forcing that $\Delta$ must be (at least) a perfect square.

but I like to know if there is a simpler way to determine $x,y$.

Thanks.

• How do you know that $(n(n+1))/4$ is an integer? – G Tony Jacobs Oct 22 '17 at 13:54
• @GTonyJacobs, that is also my problem in this method :( – asad Oct 22 '17 at 13:57
• I see. I mean, it's valid when $n$ is congruent to $0$ or $3$, modulo $4$. In other cases..... – G Tony Jacobs Oct 22 '17 at 13:58

As you say, completing the square: $$4x^2+n(n+1)x=y^2$$ $$\implies$$ $$\bigg[8x+n(n+1)\bigg]^2-\bigg[4y\bigg]^2=\bigg[n(n+1)\bigg]^2$$ $$\implies$$

A difference of two squares. Using the identity:

$$N=d_1\cdot d_2=\left(\frac{d_1+d_2}{2}\right)^2-\left(\frac{d_1-d_2}{2}\right)^2$$

Set $$d_1 \cdot d_2=\bigg[n(n+1)\bigg]^2$$

The product of consecutive integers is always even, and the square of which is always divisible by $4$:

$$n(n+1)=2\cdot m \qquad \to \qquad \bigg[n(n+1)\bigg]^2=4\cdot m^2$$

But, the only class of numbers that cannot be represented by a difference of two squares is the $2 \pmod 4$ class, the prime number factorization of which would have a single power of two. See Prove that there do not exist positive integers $x$ and $y$ with $x^2 - y^2 = n$

Since we cannot know beforehand what the power of two of $\ n(n+1) \$ will be, other than at least $1$, let $$n(n+1)=2^r \cdot P \qquad \bigg{|}\qquad r\in \mathbb{N} \ (\min\{r\}=1), \qquad P=\text{an odd product of primes}$$

Means that our

$$N=d_1 \cdot d_2=\bigg[n(n+1)\bigg]^2=2^{2r}\cdot P^2$$ then $$\bigg[8x+2^r \cdot P\bigg]^2-\bigg[4y\bigg]^2=2^{2r}\cdot P^2$$

If we were to starting dividing by $2$, to maintain the difference of squares on the left, we would need to do it an even number of times. Suppose we do it $2k$ times for some $k\in \mathbb{N}$. Then we would have

$$\bigg[2^{3-k} \cdot x+2^{r-k} \cdot P\bigg]^2-\bigg[ 2^{2-k} \cdot y\bigg]^2=2^{2r-2k}\cdot P^2$$

Note that the exponent on the right is strictly even and cannot reach $1$, which if it did, would result in trying to equate a $2 \pmod 4$ number to a difference of squares, which we know to be an impossible task.

For the equation.

$$4x^2+n(n+1)x=y^2$$

It is necessary to factorize.

$$n(n+1)=abc$$

The decision will be.

$$x=\frac{c(b-a)^2}{16}$$

$$y=\frac{c(b-a)(b+a)}{8}$$