Existence of positive integer solution of a equation

73 Views Asked by At

I'm trying to find if the following equation has positive integer solutions

$$x + (x+y) + (x+2y) + (x+3y) + \cdots + (x+(n-1)y) = z$$

where $z$ and $n$ are given. I can't progress further.

-> $xn + ((n(n-1))/2)*y = z $

-> $(2xn + (n(n-1)y)/ 2 = z $

-> $2xn +n^2y-ny = z$

-> $n(2x + ny - y) = 2z $

Please help me. I don't necessarily need the values of $x, y$. I just want to if there are any satisfying $x$ and $y$ for a particular $n$ and $z$.

2

There are 2 best solutions below

2
On

From your last equation

$$x=\frac{z}{n}-\frac{(n-1)}{2}y.$$

We need a solution such that $y>0$ and

$$\frac{z}{n}>\frac{(n-1)}{2}y,$$

that is

$$0<y<\frac{2z}{n(n-1)}$$

Clearly there are infinitely many suitable $y$'s for a given $n$ and $z$.

0
On

You have $$nx+(1+2+3+.....+(n-1))y=z\iff nx+\frac{(n-1)n}{2}y=z$$ Making $z=tn$ you get $$x+(n-1)y=t\iff 2x+(n-1)y=2t$$ Reducing for $n$ odd you have $$X+kY=T$$ which have infinitely many known solutions