It’s not going to be a particularly simple expression, but you can generate $A$ from $a$ with a sequence of matrix operations. I’ll describe the building blocks here and let you work out the specific operations for what you’re trying to do on your own.
- Left-multiplying a matrix by the $k$th row of the identity matrix picks out the $k$th row of that matrix. If it’s a column vector, this will pick out the $k$th element.
- Right-multiplying by the $k$th column of the identity picks out the $k$th column.
- Right-multiplying a column vector with $m$ rows by a row vector with $n$ produces an $m\times n$ matrix.
From the first point it follows that left-multiplying by a permutation of the identity will apply the same permutation to the rows of the matrix. Similarly, right-multiplying by a permutation of the identity will permute the columns.
To trim off the trailing $k$ elements of column vector, the first point tells us that we should multiply by the identity matrix with the last $k$ rows deleted.
Applying the second and third points, we can find that multiplying a column vector $v$ by the row vector $(1,0,0)$ produces the matrix $(v,0,0)$, i.e., the matrix with $v$ as its first column and zeros everywhere else.
To get you started, the matrix that rotates the elements of an $n$-element column vector down one slot would be $$
$$ i.e., $I$ with its rows rotated down by one.