prime sequence prove that $p_n\ne 5$ i was preparing for olympiad then I got this question
Let $$<p_1,p_2,,,,p_n,,,>$$ be a sequence of primes defined by$p_1=2$ and for $n\ge 1$,$p_{n+1}$ is the largest prime factor of $p_1p_2...p_n+1$.Prove that $p_n\ne 5$ for any $n$.
I put $p_2=3,p_3=7$ 
I think sequence is increasing
 A: Let $q_1=2$, $q_{n+1}=1+\prod_{k=1}^np_k$, so $p_n$ is the greatest prime factor of $q_n$.
If $p_n=5$ for some $n$ then $5$ is the greatest prime factor of $q_n$. Also we know that $n\ge 3$ because $p_1=2$ and $p_2=3$. Then $q_n$ is not a multiple of $2$ nor $3$. Therefore $q_n$ is a power of $5$.
This implies that $q_n-1$ is a multiple of $4$, but this is impossible because $q_n-1$ is a product of different primes.
A: By data $p_1=2,p_2=3,p_3=7$, It follows from induction that $p_n (n\ge2 )$ is odd. [For if $p_2,p_3.......p_{n-1}$ are odd then $p_1p_2...p_{n-1}+1$is also odd and not 3. This also follows from induction].
For if $p_3=7$ and $p_3, p_4,p_{n-1}$ are neither $2$ nor $3$ then $p_1p_2...p_n+1$ is neither divisible by $3$ nor by $2$. So, $p_n$ is neither $3$ nor $2$.
Now assume that $p_n=5$ is the only prime divisor of LHS so $2p_2...p_{n-1}=5^n-1$. RHS is divisible by $4$ but LHS is not which gives us required contradiction.
We all have source called internet so consider it first before posting your problem on MSE.
A: Suppose $p_k=5$ for some $k>1$. This means that $p_1\cdots p_{k-1}+1=2^a3^b5^c$ for $c>0$. Since $p_1=2$ and $p_2=3$, $a=b=0$. So $p_1\cdots p_{k-1}+1=5^c$. Then:
$p_1\cdots p_k+1=(5^c-1)5+1=5^{c+1}-4.$
However,
$$5^{c+1}-4\equiv 2^{c+1}-1\pmod{3}\equiv 1 \pmod{3}.$$
So, $2^{c}\equiv 1\pmod{3}$. So $c$ must be even, e.g. $c=2d$. A quick calculation gives $p_3=7$. Yet, $5^{2d}-4\equiv(-3)^d+3\pmod{7}$, which is never equivalent to 1 mod 7. 
