How many ordered pairs of positive integers $(a, b)$ are there such that $a!+\dfrac{b!}{a!}$ is a perfect square?

Is the number of solutions finite?

Source: Ran into it on Facebook.

I have plugged in small numbers to see that $(1,4), (4,4)$ etc. work. But other than that I have no idea how to approach. Any help will be appreciated.


  • $\begingroup$ a = 7 and b = 7 is another solution $\endgroup$ – bobbym Jul 13 '14 at 11:59
  • $\begingroup$ Duplicate of this. $\endgroup$ – Lucian Jul 13 '14 at 18:26

Suppose $a!=y$, then, $y+b!/y=x^2$ for some integer $x$, we have, $y^2-yx^2+b!=0$ a quadratic in $y$, so the discriminant must be a square, hence, $(x^2)^2-4b!=z^2$ for some $z$, we have, $(x^2)^2-(b!)(2)^2=z^2$, a rational Pell equation

  • $\begingroup$ Wonderful answer $\endgroup$ – Bumblebee Jul 14 '14 at 8:54
  • $\begingroup$ So, what is the conclusion? Have you managed to answer the case $a=1$ at all? $\endgroup$ – punctured dusk Jul 22 '14 at 20:08


I do not think this can be answered. Supposing you say that $a!+\dfrac{b!}{a!}=n^2$ has a finite number of solutions. Then we could say that for a = 1! and $ b \neq 1! $ there are a finite number of solutions. But that is the well known Brocard's problem which is still an open problem. http://en.wikipedia.org/wiki/Brocard%27s_problem

Where am I going wrong?

  • $\begingroup$ You're not wrong, the question is likely to be extremely difficult. $\endgroup$ – punctured dusk Jul 22 '14 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.