There is a similar question like this. And this is extension of this question
How can we calculate the determinant of this $\,pn-1\times pn-1\,$ matrix. I have tried at my best level, and still am not able to come up with a solution. The matrix $a_{ij}$ entry is defined as $$ a_{ij} = \begin{cases} a & \text{if }~ i = j\\ 0 & \text{if }~ pk \leq i,j < p(k+1) \text{ for some }k\\ b & \text{otherwise} \end{cases} $$
It would be very nice if I can get a general formula and a clear elaboration is much appreciated.