A problem on the finiteness of solutions to a Diophantine equations

Given two positive integers $a,b$, and an odd prime $p$, I want to know whether the number of solutions to the following equation is finite:

$X^2=a+bp^{Y}$

where $X,Y$ are variables and are integers.

I checked with google, and in the case $b=1$ this seems to follow from a result of A Baker on logrithmetic forms (1966).

-
I vaguely remember something like this was in the old book by Sierpinski "Number Theory". Nice book – Victor Dec 30 '13 at 14:30

Yes, there are only finitely many solutions. Even more is true. For fixed nonzero $a$ and $b$, the equation $$x^2 = a + bz^y$$ has only finitely many solutions in integers $(x,y,z)$ with $y\ge3$. See the article on the Ramanujan-Nagell equation (and its generalizations) https://en.wikipedia.org/wiki/Ramanujan-Nagell_equation.
It is conjectured that there are only finitely many solutions $(x,y,z,w)\in\mathbb{Z}^4$ to $$x^w = a + bz^y$$ with $\max(w,y)\ge3$ and $\min(w,z)\ge2$, but this is only known for a few small values of $a$ and $b$, such as $a=1$ and $b=-1$, which is Catalan's equation.
Just a remark that equations of the shape $x^n + c = yz^k$ where $x,y,z$ are integral variables, $c$ is a fixed integer, and $n > k$ are positive integers have been investigated by D.R. Heath-Brown. In particular, he showed that if $-X \leq x \leq X$ then there are at most $O(X^{1 - \delta})$ solutions provided $k \geq (5d+4)/9$. – Stanley Yao Xiao Dec 30 '13 at 15:49