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$ .