# Finding set of values that satisfy constraint equation

We want to find set of all values that satisfy the following equation: $(a+ky)(a-ky)=gx$ All values are assumed to be nonzero integers. How does one set $x$ so that $a$ is not multiples of $y$ while there exist more than one unique solution set of other values? In this case, $a$, $k$ and $g$ are allowed to change, while $y$ must be fixed. Also, how does one compute the number of possible combinations of solutions? How does the value of $x$ relate to the number of possible solutions?

With the same constraint, what happens if $g$ is fixed to 1? And with the same constraint, what happens if we allow for $k$ of each solution to be a fraction of the form $1/q$ where $q$ is some factor of $y$ and $q$ of each solution does not have any prime factor that is a prime factor of $q$ of other solutions?

-
It isn't easy to see from the question which of $a,k,g,x,y$ are considered fixed and which are to be "solved for". By saying "$a,k,g$ are allowed to change, it looks like you are viewing $x,y$ as fixed, and then searching for $a,k,g$. Is that it? –  coffeemath Dec 29 '12 at 21:12
Yes $x$ and $y$ is set to be fixed. But the question asks which $x$ and $y$ allows the equation with constraints to be solved. And other questions. –  Milkshake Dec 29 '12 at 23:28
@coffeemath is this a difficult question? –  Milkshake Dec 29 '12 at 23:38
Given any $x,y$ define $a=x+y$ so that $a-y=x$, then define $a+y=g$, and so with $k=1$ you have $(a+ky)(a-ky)=gx$. –  coffeemath Dec 30 '12 at 1:18
My above comment is one solution to the first version. To find all solutions might be difficult. –  coffeemath Dec 30 '12 at 1:28

For the equation [1] $(a+ky)(a-ky)=gx$ (where $x,y$ are fixed positive integers, as suggested in a comment from the OP Milkshake) we may choose any positive integer $k$ and then solve by putting $a-ky=x$ and $a+ky=g$. This means we are defining $a=x+ky$ and then $a+ky=x+2ky$ so we are also defining $g=x+2ky$.
There are undoubtedly more solutions, but not so easy to determine because of the possibility of choosing any factor $g$ on the right of [1].
In a further remark of the question, it is asked what happens when one insists that $g=1$. In this case there are definite restrictions on the possible pairs $x,y$ for which [1] has solutions. That is, we consider the equation $$[2]\ \ (a+ky)(a-ky)=x.$$ If $x$ is an odd prime, then of necessity $a-ky=1$ and $a+ky=x$. So $a=1+ky$ and we get $2ky+1=x$, so that $$ky=\frac{x-1}{2}.$$ Put simply this means that $y$ must be a factor of $(x-1)/2$. Example: $x=29$ implies $y$ divides $14$ so that the possible $y$ are $1,2,7,14$.
Another simple case of [2] occurs when $x=pq$, a product of two odd primes with say $p>q$. In this case, similar to the above we can take $y$ as a factor of $(pq-1)/2$, but we may also proceed to set $a-ky=q$ and $a+ky=p$ for more solutions. That is, $a=q+ky$ so that $p=a+ky=q+2ky$ and so $ky=(p-q)/2$ which gives as solutions for $y$ the divisors of $(p-q)/2$, in addition to the above noted divisors of $(pq-1)/2$. Example: $x=95=19\cdot 5$: Here we have that $y$ is either a divisor of $(95-1)/2=47$, or else of $(19-5)/2=7$. So for $x=95$ we have possible $y=1,7,47.$
As we take $x$ with more factors, the problem looks like it would get involved, since for example with three factors we could set tyhe product of two of them to $a-ky$ and the third factor to $a+ky$; the possibilities increase with the complexity of the factorization of $x$.