# Arranging Consecutive Integers in a Continued Radical to Make a Rational Number

**Number Theory**Level 5

Find the sum of all positive integral \(n\) such that there exists a permutation \(\sigma\) of the set \(\{ 1,\ldots, n\}\) such that

\[\sqrt{\sigma(1)+\sqrt{\sigma(2)+\sqrt{\cdots+\sqrt{\sigma(n)}}}}\]

is a rational number. \(\sigma(m)\) denotes the \(m\)-th term of the permutation.