On equations $m^2+1=5^n$ I am looking for integer solutions of Diophantine equation $m^2+1=5^n$. I found that $m=0,n=0$ and $m=2,n=1$. I could not find any other solutions. I try to prove this but I could not. Could anyone help me to solve this equation?
 A: Hint: By Mihăilescu's theorem the only solution to 
$$x^a - y^b = 1$$
where $a, b > 1$ and $x, y > 0$ is 
$$3^2 - 2^3 = 1$$ 
Now  you only have to consider the remaining cases where the exponents are not both more than $1$, and where the bases are not both more than $0$.
A: HINT.-If you are interested in another way of indicated in the link given by Yiyuan Lee (a good example of that elementary could be intricate enough and not easy), you could pay attention to the following:
$m^2+1=5^n\Rightarrow n$ is odd ($m^2+1=x^2$ is impossible since the difference between $x^2$ and the square of an integer greater than $x$ is always greater or equal than $2x+1>1$).
So we have the equation $$m^2+1=5x^2\iff m^2-5x^2=-1\quad (*)$$
The Pell-Fermat equation $(*)$ has infinitely many solutions but we have to discriminate these solutions with the restriction $x$ must be a power of $5$.
It is known in Algebraic Number Theory (it is not hard to calculate) that the fundamental unit of $\mathbb Q[\sqrt 5]$ is $\frac{ 1+\sqrt 5}{2}$ so all the solutions $(m_n,x_n)$  of $(*)$ are given by
$$m_k+x_k\sqrt 5=\left(\frac{ 1+\sqrt 5}{2}\right)^k; k\ge 1\qquad (**)$$
Calculation gives
$$2^k(m_k+x_k\sqrt 5)=(1+\sqrt 5)^k=1+\binom k1\sqrt 5+\binom k2(\sqrt 5)^2+\binom k3(\sqrt 5)^4+…..+\binom k2(\sqrt 5)^{k-2}+\binom k1(\sqrt 5)^{k-1}+(\sqrt 5)^k$$ 
Hence you have according if $k$ is even or odd
$$2^{2k}x_{2k}=\binom {2k}1+5\binom {2k}3+5^2\binom {2k}5+5^3\binom {2k}7+…..5^{k-1}\binom {2k}1$$
$$2^{2k+1}x_{2k+1}=\binom {2k+1}1+5\binom {2k+1}3+5^2\binom{2k+1}5+5^3\binom {2k+1}7+…..+5^{k-1}\binom {2k+1}2+5^k$$
I leave to you the task of verifying that it is not possible that any $x_k$ is a power of $5$.
A: Since $(1+mi)(1-mi)=(1+2i)^n(1-2i)^n$, we must have $1+mi=(1+2i)^n$ or $1-mi=(1+2i)^n$. If both $1+2i$ and $1-2i$ divide either $1+mi$ or $1-mi$, then $5$ would divide it, too, which is impossible since $5\nmid1$.
In this answer, it is shown that for $n\ge2$, $\mathrm{Re}\left((1+2i)^n\right)\ne1$.
Therefore, $m^2+1=5^n$ can only have solutions for $n=0$ ($m=0$) and $n=1$ ($m=2$).
A: Note: This is building on Yiyuan Lee's answer, which suggested
applying Catalan's conjecture / Mihăilescu's theorem (CCMT). 
We start with
$$
m^2 + 1 = 5^n \quad (m, n) \in \mathbb{Z}^2
$$
and rewrite it as
$$
5^a - y^2 = 1 \quad (a, y) \in \mathbb{Z}^2 \quad (*)
$$
to compare it with CCMT's
$$
x^a - y^b = 1
$$
Case 1:
CCMT says for natural numbers $a,b,x,y$ with $a, b > 1$, $x, y > 0$ there is only the solution
$$
3^2 - 2^3 = 1
$$
This means there is no solution for $(*)$ for $(a,y) \in \mathbb{Z}^2$, $a > 1$, $y > 0$.
Case 2:
We can drop the case $y < 0$, as
$$
1 = 5^a - y^2 = 5^a - (-(-y))^2 = 5^a - (-y)^2 
$$ 
so no new solutions are possible. 
Case 3:
The case $y = 0$ leads to
$$
5^a = 1
$$
which has no solution for $a > 1$. We covered $a > 1$, $y \in \mathbb{Z}$ so far.
Case 4:
For $a = 1$, $y \in \mathbb{Z}$ we have
$$
5 - y^2 = 1 \iff \\
y^2 = 4 \iff \\
y = \pm 2
$$
which gives the solutions $(a,y) = (1, \pm 2)$. This has covered $(a,y) \in \mathbb{N} \times \mathbb{Z}$.
Case 5:
For $a = 0$, $y \in \mathbb{Z}$ we have
$$
1 - y^2 = 1 \iff \\
y^2 = 0 \iff \\
y = 0
$$
which gives the addtional solution $(a,y) = (0,0)$. Covered so far: $\mathbb{N}_0 \times \mathbb{Z}$.
Case 6:
Now going for $a < 0$, $(a, y) \in \mathbb{Z}^2$. We get
$$
5^a - y^2 = 1 \iff \\
5^{-(-a)} - y^2 = 1 \iff \\
\underbrace{\frac{1}{5^{-a}}}_{< 1} = \underbrace{1 + y^2}_{\ge 1}
$$
so no additional solution is possible.
A: First of all, $y\ge0$, and an even $y$ it may be only in the case of $y=0$ -- when the difference between the squares of numbers is equal to 1. In all other cases $y$ odd. Let $z=5^{(y-1)/2}$ and consider the diophantine equation $x^2+1=5z^2$. It has an infinite number of solutions, but they can be clearly described, and then verify that $z$ may be a power by 5 only for the case $z=1$.
If $(x,z)$ -- solution of the equation, then the same holds for the pair $(9x+20z,4x+9z)$. Really, $5(4x+9z)^2-(9x+20z)^2=5z^2-x^2=1$. According to this rule, from the initial decision $(2;1)$ continue to receive a pair of $(38;17)$, $(682;305)$, ... and so on. Making components at the same time satisfy the recurrence relation $z_{n+2}=18z_{n+1}-z_n$ at $n\ge0$, where $z_0=1$, $z_1=17$.
For starters check that this series describes all the solutions of the equation in positive integers. Consider the inverse transformation $(x,z)\mapsto(9x-20z,-4x+9z)$, is also it takes a decision in the decision. It provides solutions in positive integers if $\frac{x}z\in(\frac{20}9;\frac94)$, and both coordinates in such a transformation are reduced. It is easy to check that out $\frac{x}z\le\frac{20}9$ must be $z\le4$, and a decision to this limitation, we have only one, where $z=1$. It is also understood that $x^2 < 5z^2 < \frac{81}{16}z^2$, and inequality $\frac{x}z < \frac94$ it is always satisfied.
Thus, any solution in a finite number of steps the reverse transformation to $(2;1)$, which implies a complete description.
Now consider the sequence of values $z_m$, given by the recurrence relation: $1$, $17$, $305$, $5473$, ... . 
We are interested in those values, which are divided into $5$. Considering the sequence modulo 5, we have 1, 2, 0, 3, 4, 4, 3, 0, 2, 1, 1, 2, ... , wherein the period is 10, and multiples of 5, meet for a period of 5 $n=5m+2$.
The number 305, which we meet here, is also divided by 61. It is therefore natural to check the residues modulo 61. In this module we have the following: 1,17,0,44,60,60,44,0,17,1, 1.17, ..., that is also equal to period 10, and zeros are exactly the same places. This means that all the sequence numbers that are multiples of 5, as a multiple of 61 and 5 degrees among them.
A: Here's a long solution that uses Pell equations.
$m^2+1=5^n$
$m^2+1$ is an integer, therefore $n\ge 0$.
There are two cases.
$1) $ $n$ is even. $n=2k$, $k\ge 0$. Then $\left(5^k+m\right)\left(5^k-m\right)=1$.
WLOG let $m\ge 0$, because $m$ is a solution if and only if (iff) $-m$ is a solution.
If $m\ge 1$, then $5^k+m>1$, contradiction. Therefore $m=0$, $(m,n)=(0,0)$.
$2) $ $n$ is odd. $n=2k+1$, $k\ge 0$. Let $y=5^k$, $m=x$.
Then $x^2-5y^2=-1$ looks like a Pell equation.
$(x_1,y_1)=(\pm 2,\pm 1)$. See my answer here for how to solve Pell equations.
In particular, the solution given in http://vjimc.osu.cz/history 2015 Category II Solutions Problem 2 is very similar, analogous to what I'll do here. I've also posted an analogous answer here.
The solutions, in this case, are given by $$x_v=\pm \frac{(2+\sqrt{5})^{2v-1}+(2-\sqrt{5})^{2v-1}}{2}$$
$$y_v=\pm \frac{(2+\sqrt{5})^{2v-1}-(2-\sqrt{5})^{2v-1}}{2\sqrt{5}}$$
$v=1,2,\ldots$ $$2\sqrt{5}\cdot 5^k=(2+\sqrt{5})^{2v-1}-(2-\sqrt{5})^{2v-1}$$
Clearly $(2+\sqrt{5})^{2v-1}>(2-\sqrt{5})^{2v-1}$.
If $k=0$, then $n=1$, $(m,n)=(\pm 2,1)$. Let $k\ge 1$.
$$5^k=\binom{2v-1}{1} 4^{v-1}+\binom{2v-1}{3} 4^{v-2}\cdot 5+$$
$$+\cdots+\binom{2v-1}{2v-1} 5^{v-1}$$
$$\implies 2v-1\equiv 0\pmod{5}$$
$(2v-1)/5$ is odd.
$$2\sqrt{5}\cdot 5\cdot 61=(2+\sqrt{5})^{5}-(2-\sqrt{5})^{5}\mid$$
$$\mid (2+\sqrt{5})^{2v-1}-(2-\sqrt{5})^{2v-1}=2\sqrt{5}\cdot 5^k,$$
contradiction. I think this divisibility result is true.
How do I know that $$b_5:=(2+\sqrt{5})^5+(2-\sqrt{5})^5\mid $$
$$\mid (2+\sqrt{5})^{2v-1}+(2-\sqrt{5})^{2v-1}=:b_{2v-1}?$$
((($:=$ denotes "equal by definition")))
Here I used $+$ instead of $-$.
Well, the solution of $5^n=6m^2+1$ which I gave in the beginning of this answer uses this
and also see this link from AoPS. I won't be self-contained here.
v_Enhance said that, in this case: "$b_{2v-1}/b_5$ is both rational and an algebraic integer."
Kent Merryfield has a longer answer, which you should see for yourself.
