3

Looking for a solution for such a challenge, I have a decision problem that is solved if there is a positive integer $c$, which for given integer constants $a$, $b$ satisfies the equation

$a+c^2 \equiv 0 \pmod {2b-2c}$

or simply to say $a+c^2$ is divisible by $2b - 2c$.

Additional facts, maybe helpful

  • $0<c<b$
  • $a<2b$

Not sure how to approach this, beside brute force, looking for an elegant solution.

2 Answers2

1

Note that $$a+c^2=k(2b-2c)$$ Becomes a quadratic in $c$ $$c^2+2kc+(a-2kb)=0$$ for which $$c=-k\pm \sqrt{k^2+2kb-a}$$and $c$ is an integer iff $k^2+2kb-a=d^2$ for some integer $d$ so that $$k=-b\pm\sqrt{b^2+a+d^2}$$ whence $$b^2+a+d^2=e^2$$ so that$$a+b^2=-d^2+e^2=(e+d)(e-d)$$

And if this equation has a solution we obtain $$k=-b\pm e$$ and $$c=b\pm e\pm d$$

Mark Bennet
  • 100,194
  • Thank You for giving me a different view on the problem. This however changes it to searching for pair (d,e), which I also not sure how to do other than brute force - is there a way? I would leave the question unanswered until tomorrow, if this is OK, so others might get a look as well. – Marcin Gałczyński Apr 25 '14 at 12:02
  • @MarcinGałczyński It is well-known which integers can be expressed as the sum of two squares (those having no prime factor of the form $4m+3$ appearing to an odd power). Efficiently finding such is discussed http://math.stackexchange.com/questions/5877/efficiently-finding-two-squares-which-sum-to-a-prime – Mark Bennet Apr 25 '14 at 12:12
  • While testing in practice this solution, I believe I run onto an error. $k^2+2kb−a=d^2$ gets translated into $k=+/-sqrt(d^2+b^2+a)-b$ which leads to $a+b^2=e^2-d^2$ which leads to Fermat factorization problem in the end. – Marcin Gałczyński Apr 25 '14 at 17:46
  • @MarcinGałczyński Thanks for pointing out the error - now it requires $a+b^2$ to be odd or divisible by $4$ so it has two factors of the same parity. – Mark Bennet Apr 26 '14 at 08:16
1

There are many choices for $c$, depending on the given integers $a$ and $b$.

Given $a+c^2 \equiv 0 \pmod {2b-2c}$, subtract $b^2$ from both sides;$a+c^2-b^2 \equiv -b^2\pmod {2b-2c}$

multiplying through by $2$; $2a+(2c-2b)(c+b) \equiv -2b^2 \pmod {2b-2c}$ or $2(a+b^2) \equiv 0 \pmod {2b-2c}$. Or $(a+b^2) \equiv 0 \pmod {b-c}$ From here, input the given values of $a$ and $b$, then equate any factor of $a+b^2$ (that is less than $b$) to $b-c$