IMC 2007 · Problem 4

Day 214th IMC · Blagoevgrad, Bulgaria

Statement

Let n>1n > 1 be an odd positive integer and A=(aij)i,j=1nA = (a_{ij})_{i,j=1\dots n} be the n×nn \times n matrix with

aij={2if i=j1if ij±2(modn)0otherwise.a_{ij} = \begin{cases} 2 & \text{if } i = j \\ 1 & \text{if } i - j \equiv \pm 2 \pmod{n} \\ 0 & \text{otherwise.} \end{cases}

Find detA\det A.

Official solution

Hidden so you can work on the problem first.