5. Given the sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=a>2, a_{2017}=$ 2017, and for any positive integer $n, a_{n+1}=a_{n}^{2}-2$. Then $\left[\frac{\sqrt{a-2}}{10^{6}} a_{1} a_{2} \cdots a_{2017}\right]=$ $\qquad$, where $[x]$ denotes the greatest integer not exceeding the real number $x$.
5.2.

Let $a_{1}=a=2+\varepsilon(\varepsilon>0)$.
Then $a_{2}=a_{1}^{2}-2=(2+\varepsilon)^{2}-2$
$$
\begin{array}{l}
=2+4 \varepsilon+\varepsilon^{2}>2+4 \varepsilon, \\
a_{3}=a_{2}^{2}-2>(2+4 \varepsilon)^{2}-2 \\
=2+16 \varepsilon+16 \varepsilon^{2}>2+16 \varepsilon .
\end{array}
$$

Using mathematical induction, we can prove: for any positive integer $n$,
$$
a_{n} \geqslant 2+4^{n-1} \varepsilon \text {. }
$$

Thus $2017=a_{2017}>2+4^{2016} \varepsilon$
$$
\Rightarrow 02$, then
$$
\begin{array}{l}
a_{1} a_{2} \cdots a_{2017}=2017 \sqrt{\frac{2017^{2}-4}{a^{2}-4}} . \\
\text { Hence }\left[\frac{\sqrt{a-2}}{10^{6}} a_{1} a_{2} \cdots a_{2017}\right] \\
=\left[\frac{2017}{10^{6}} \sqrt{\frac{2017^{2}-4}{a+2}}\right] .
\end{array}
$$

Substituting $a=2+\varepsilon$ and using equation (2), we get
$$
\left[\frac{\sqrt{a-2}}{10^{6}} a_{1} a_{2} \cdots a_{2017}\right]=2
$$