# How to find a general condition when $a^2=y^2-\frac{py}{c}$ holds

Suppose that there are nonzero natural numbers $a,y,c,p$. These numbers are defined to be related by the following:

$$a^2=y^2-\frac{py}{c}$$

What would be the necessary condition on these numbers to satisfy this constraint? I do know that by substituting some values would satisfy the constraint. What I want to know is the general condition when this holds.

Edit: Suppose that $p$ is fixed (prime) number. What would we be able to figure the relationship among $c,a,y$? The relationship seem to be able to defined easily; however, the problem is, these numbers got to be natural numbers. I am having a hard time dealing with this.

Edit 2: This was one of the notorious assignments given at my college. (Actually, not exactly, but in solving it seem to require this...)

Edit 3: I guess $p$ being composite is also fine.

-

If you just want a way to give all possible natural numbers $a,y,c,p$ satisfying your equation, then the only assumption you need is that $y>a$. In this case your equation is equivalent to $$\frac{y^2-a^2}{y}=\frac{p}{c}.$$ We can now assume that $y,a$ are fixed natural numbers with $y>a$. Write the fraction $(y^2-a^2)/y$ in lowest terms as $m/n$ (where $\gcd(m,n)=1$). Then the values of $p,c$ are common multiples of $m,n$, namely there is positive integer $k$ with $p=mk,q=nk$. This describes all the solutions $a,y,c,p$ in positive integers of your equation.

EDIT: the questioner has now put it that $p$ is to be a fixed prime number. That is, the equation is now $$py=c(y^2-a^2).$$
ADDED NOTE: From the original equation, one can get to $ca^2=cy^2-py$, and then on multiplying by $4c$ and completing the square, to $(2ca)^2=(2cy-p)^2-p^2.$ So from your equation in integers we get pythagorean triples $[p,2ca,2cy-p].$ However it's unclear to me how to "work backward" from pythagorean triples and obtain all solutions of your equation, since one must have the entries of the triple in the special forms $[p,2ca,2cy-p].$ Still it seems interesting how the equation relates to pythagorean triples!
RE-EDIT. The questioner has now allowed $p$ composite also, but still the idea is to have $p$ fixed, and look for the $a,y,c$ making the equation hold. So now it looks even more complex to find all solutions!
This seems more interesting, and can be divided into cases as to whether $p$ divides $c$,in which case putting $c=pk$ makes the equation $y=k(y^2-a^2)$, or $p$ does not divide $k$, in which case $p$ must divide one of $y-a,y+a$. This breakdown may be a start.
I'm stiull looking at this, and if more were known about what type of $p$ you want (say prime, or prime times a square), there may be some good next step. I get a lot of extra variables on using gcd's and so on, and it got involved keeping track of the equations. One thing is it might be good to look at $\gcd (y,y^2-a^2)$ and cancelling it. If I find anything else I'll throw it in. Cheers. – coffeemath Nov 1 '12 at 18:38