6、Positive real numbers $a_{1}, a_{2}, \mathrm{~L}, a_{n}$ satisfy $\sum_{i=1}^{n} a_{i}=17$, and $\sum_{i=1}^{n} \sqrt{a_{i}^{2}+(2 i-1)^{2}}$ has a minimum value that is an integer, then $n=$
6. 12

Analysis: Consider each term $t_{i}=\sqrt{a_{i}^{2}+(2 i-1)^{2}}$ as the hypotenuse of a right triangle with legs $2 i-1$ and $a_{i}$. By connecting these right triangles to form a "ladder" (ensuring the right-angle sides are parallel), let $A, B$ be the endpoints of the zigzag line formed by the hypotenuses. The distance between $A$ and $B$ is $\sqrt{17^{2}+n^{4}}$, so $\sum_{i=1}^{n} t_{i} \geq \sqrt{17^{2}+n^{4}}$. By choosing appropriate $a_{i}$, the equality can be achieved, making the zigzag line a straight line. Therefore, the minimum value of $\sum_{i=1}^{n} \sqrt{a_{i}^{2}+(2 i-1)^{2}}$ is $\sqrt{17^{2}+n^{4}}$. Since $\sqrt{17^{2}+n^{4}}$ is an integer, let $t=\sqrt{17^{2}+n^{4}}$, then $\left(t-n^{2}\right)\left(t+n^{2}\right)=17^{2}$, solving this gives $t=145, n=12$