Evaluate $$\det \begin{vmatrix} 1 & 1& \dots &\ldots&1&a \\ 1 & 1& \dots &\ldots&a&1 \\ \vdots & \vdots& \ddots &&\vdots&\vdots \\ \vdots & \vdots&&\ddots&\vdots&\vdots \\ 1 & a& \dots &\ldots&1&1\\ a & 1& \dots &\ldots&1&1 \\ \end{vmatrix}$$
I tried cofactor expansion and it leads to $$\det \begin{vmatrix} 1& \dots &\ldots&a&1 \\ \vdots& \ddots &&\vdots&\vdots \\ \vdots&&\ddots&\vdots&\vdots \\ a& \dots &\ldots&1&1\\ 1& \dots &\ldots&1&1 \\ \end{vmatrix} - \det \begin{vmatrix} 1 & \dots &\ldots&a&1 \\ \vdots & \ddots &&\vdots&\vdots \\ \vdots & &\ddots&\vdots&\vdots \\ 1 & \dots &\ldots&1&1\\ a & \dots &\ldots&1&1 \\ \end{vmatrix} + \ldots +(-1)^{n+1} \det \begin{vmatrix} 1 & 1& \dots &\ldots&a \\ \vdots & \vdots& \ddots &&\vdots \\ \vdots & \vdots&&\ddots&\vdots \\ 1 & a& \dots &\ldots&1\\ a & 1& \dots &\ldots&1 \\ \end{vmatrix}$$
I think, except for last term, all the terms will be cancel each other somehow although it may depend on parity of $n$. If it does depend on parity, the possibility of cancelation is going to be opposite for the cofactor expansion of the last term, and so it does for the last term of the next expansion...
I could not find out how to deal with this branch.