
EXAMPLE

For n=2, a few of the possible matrices are [0,0,1,0,1,0,1,0,0], [0,0,1,0,1,0,1,0,1], [0,0,1,0,1,0,1,0,2], [1,0,0,0,1,1,2,0,1], [1,0,0,0,1,1,2,1,0], [1,0,0,0,1,1,2,1,2], [2,2,1,2,1,2,1,0,2], [2,2,1,2,1,2,1,1,0], [2,2,1,2,1,2,1,1,1], [2,2,1,2,1,2,1,2,0], .... There are 2022 possibilities.
Here each of the matrices is defined as M=[a,b,c,d,e,f,g,h,i] where a=M[1][1], b=M[1][2], c=M[1][3], d=M[2][1], e=M[2][2], f=M[2][3], g=M[3][1], h=M[3][2] and i=M[3][3].
So, for n=2, a(n)=2022.
