6. Given the sequence $\left\{a_{n}\right\}$

satisfies
$$
a_{n}=\sqrt{1+\frac{1}{n^{2}}+\frac{1}{(n+1)^{2}}}(n \geqslant 1),
$$

and its first $n$ terms sum is $S_{n}$. Then $\left[S_{n}\right]=$ $\qquad$ ( $[x]$ represents the greatest integer not exceeding the real number $x$).
6. n.

From the given, we have
$$
\begin{array}{l}
a_{n}=\sqrt{1+\frac{1}{n^{2}}+\frac{1}{(n+1)^{2}}} \\
=\sqrt{\frac{[n(n+1)]^{2}+(n+1)^{2}+n^{2}}{n^{2}(n+1)^{2}}} \\
=\frac{n(n+1)+1}{n(n+1)}=1+\frac{1}{n}-\frac{1}{n+1} .
\end{array}
$$

Then, $S_{n}=\left(1+\frac{1}{1}-\frac{1}{2}\right)+\left(1+\frac{1}{2}-\frac{1}{3}\right)+\cdots+$
$$
\begin{array}{l}
\quad\left(1+\frac{1}{n}-\frac{1}{n+1}\right) \\
=n+1-\frac{1}{n+1} .
\end{array}
$$

Thus, $\left[S_{n}\right]=n$.