I'm trying to find the number of positive integer solutions, in terms of $a$ and $b$, to the equation:


I have tried many approaches but couldn't seem to get an answer. Is this possible?


I should make clear that $x$ and $y$ are variables whose only restrictions are that they must be positive integers, and $a$ and $b$ are positive integer constants.

I am looking to find the number of unique $x,y$ pairs given the constants $a$ and $b$.

  • $\begingroup$ I'm guessing squares won't work since it introduces extra terms unfortunately $\endgroup$ Jul 11, 2018 at 0:40
  • $\begingroup$ Yes, you're right. I'm thinking whether you need quadratic reciprocity to solve this problem or not. $\endgroup$ Jul 11, 2018 at 0:42

2 Answers 2


$$ (2x+2y+a+b)(2x-2y+a - b)= a^2 - b^2 $$ Given all ways to factor $a^2 - b^2 = UV$ with $U \equiv V \equiv a+b \pmod 2 \; ...$

It is necessary to include pairs with $U,V$ negative as well as positive.

  • $\begingroup$ Thanks for your answer, however I'm having some trouble implementing this. I'm looking for the number of unique positive solutions for $x$ and $y$, however the number of ways to factor $a^2-b^2$ is likely greater than the number of ways it can be factored in that specific form, since it has restrictions in terms of the constants $a$ and $b$. Any suggestions? $\endgroup$ Jul 11, 2018 at 2:21
  • $\begingroup$ For example, $a=6$, $b=4$ gives $(2x+2y+10)(2x-2y+2)=20$, so in this case the factor pairs (4, 5) and (10, 2) cannot be counted as solutions must be positive. $\endgroup$ Jul 11, 2018 at 2:45

Above equation shown below:

$x^2+ax=y^2+by$ -------$(1)$

Equation $(1)$ has parametric solution & is given below:





For $k=3$, we get $(x,y,a,b)= (11,55,19, (-49))$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .