This is a quantum chemistry problem I'm working on; not a homework problem - something I need for an article I'm writing. I don't think knowing the chemistry is important, as at this point it seems to be "just a math problem". I can give some chemical background leading to the formulation of the problem, if that helps.

The problem is as follows:

I need to find a general solution to the determinant of an n x n matrix (call it M) with elements M(ij) defined as:

M(ij) = x, if i = j

M(ij) = a, if |i-j| = 1 and i+j = 3, 7, 11, ....

M(ij) = b, if |i-j| = 1 and i+j = 5, 9, 13, ....

M(ij) = 0 otherwise.

For example, the M(n = 6) matrix would be:

x a 0 0 0 0

a x b 0 0 0

0 b x a 0 0

0 0 a x b 0

0 0 0 b x a

0 0 0 0 a x

Basically, the "a's" and "b's" alternate.

Can the determinant of this matrix be expressed generally as a function of a, b, x and n?