On equations $m^2+1=5^n$
Solution 1:
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$.
Solution 2:
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$.
Solution 3:
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$).
Solution 4:
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.
Solution 5:
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.