3. Let $[x]$ denote the greatest integer not exceeding the real number $x$. Suppose the sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=1, a_{n}=\left[\sqrt{n a_{n-1}}\right]$. Then the value of $a_{2017}$ is $(\quad)$.
(A) 2015
(B) 2016
(C) 2017
(D) 2018
3. A.

Notice that, $a_{2}=[\sqrt{2}]=1, a_{3}=[\sqrt{3}]=1$,
$$
\begin{array}{l}
a_{4}=[\sqrt{4}]=2, a_{5}=[\sqrt{5 \times 2}]=3, \\
a_{6}=[\sqrt{6 \times 3}]=4 .
\end{array}
$$

Use induction to prove: $a_{n}=n-2(n \geqslant 3)$.
It is easy to see that, $a_{3}=3-2$.
If $a_{k-1}=k-3(k \geqslant 4)$, then
$$
\begin{array}{l}
k a_{k-1}=k^{2}-3 k \in\left[(k-2)^{2},(k-1)^{2}\right) \\
\Rightarrow a_{k}=\left[\sqrt{k a_{k-1}}\right]=k-2 .
\end{array}
$$

Therefore, $a_{2017}=2015$.