<s>[INST] Solve $n$th order determinant Solve $n$th order determinant:
$$
    \begin{pmatrix}
    1 & 2 & 3 & \cdots & n-2 & n-1 &n\\
    2 & 3 & 4 & \cdots & n-1& n& 1\\
    3 & 4 & 5 & \cdots & n &1 &2\\
    \vdots& \vdots& \vdots& \ddots& \vdots& \vdots&\vdots\\
    n-2 &n-1&n &\cdots &n-5 &n-4 &n-3\\
    n-1 &n&1 &\cdots &n-4 &n-3 &n-2\\
    n &1&2 &\cdots &n-3 &n-2 &n-1\\
    \end{pmatrix}
$$
I tried adding $2$nd to $n$th row to the $1$st row, then the first row is:
$$
   \begin{pmatrix}
   \frac{n(n+1)}{2} &\frac{n(n+1)}{2} \cdots \frac{n(n+1)}{2}\\
   \end{pmatrix}
$$
then I took out $\frac{n(n+1)}{2}$ from the first row to get 
$$
   \begin{pmatrix}
   1 & 1 & \cdots& 1\\
   \end{pmatrix}
$$
and then tried to work with that but I don't think this is the correct approach because anything I tried doesn't look nice. 
 [/INST] This is a circulant matrix, where one can show the following formula for its determinant:
Determinant of circulant matrix
For
$$
A=\begin{pmatrix}
a_1 & a_2 & a_3 & \cdots & a_n\\
a_2 & a_3 & a_4 & \cdots & a_1\\
a_3 & a_4 & a_5 & \cdots & a_2\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a_n & a_1 & a_2 & \cdots & a_{n-1}\\
\end{pmatrix}
$$
we have
$$
\det (A) = (-1)^{\left\lfloor\frac{n}{2}\right\rfloor}\prod_{j=0}^{n-1}\left(a_n + \sum_{k=1}^{n-1} a_k\omega_j^k\right),
$$
where $\omega_j=e^{\frac{2\pi i j}{n}}$.
In our case it is
$$
(-1)^{n - 1}n^{n - 2}(n^2 + n)/2,
$$
see OEIS, and
Interesting determinant problem
</s>