8. Arrange the $n$ consecutive positive integers from 1 to $n$ ($n>1$) in a sequence such that the sum of every two adjacent terms is a perfect square. The minimum value of the positive integer $n$ is $\qquad$ .
Let the set of these $n$ consecutive positive integers be $M=\{1,2, \cdots, n\}$. Since the smallest number that can pair with 2 to form a perfect square is 7, then $n \geqslant 7$. At this point, from 1 to 7, the pairs can be arranged as follows: $(1,3,6),(4,5),(2,7)$, but they cannot form a 7-term sequence. Adding 8 can only pair with 1, adding 9 can only pair with 7, and adding 10 can only pair with 6, resulting in new triplets: $(8,1,3,6,10),(4,5),(2,7,9)$, which still cannot be connected.
This indicates that the perfect square needs to increase to 25, and the smallest number in $1 \sim 10$ that can pair with 25 is 15, thus $n \geqslant 15$. When $n=15$, the following arrangement can be constructed:
$8,1,15,10,6,3,13,12,4,5,11,14,2,7,9$ which satisfies the condition.
Therefore, the minimum value of the positive integer $n$ is 15.