Elements of $GF(3^n)$ with given trace and subtrace

If $a$ is an element of $GF(3^n)$, then the (absolute) trace of $a$ is \[ \operatorname{tr}(a)=a+a^3+a^9+\cdots+a^{3^{n-1}}. \] Alternatively, we could define $\operatorname{tr}(a)$ to be the negation of the coefficient of $x^{n-1}$ in the (characteristic) polynomial \[ p(x) = (x - a) (x - a^3) (x - a^9) \cdots (x - a^{3^{n-1}}). \] The subtrace of $a$ is the coefficient of $x^{n-2}$ in $p(x)$. The coefficients of $p(x)$ are guaranteed to be elements of $GF(3)$, so the trace and subtrace are elements of $GF(3)$ (i.e., the value is 0, 1 or 2).

(trace,subtrace)
$n$ (0,0) (0,1) (0,2) (1,0)
(2,0)
(1,1)
(2,1)
(1,2)
(2,2)
1 1 0 0 1 0 0
2 1 2 0 0 1 2
3 3 0 6 3 3 3
4 9 12 6 9 12 6
5 21 30 30 30 21 30
6 99 72 72 81 81 81
7 225 252 252 225 252 252
8 729 702 756 756 729 702
9 2187 2268 2106 2187 2187 2287
10 6561 6480 6642 6561 6480 6642
11 19845 19602 19602 19602 19845 19602
12 58563 59292 59292 59049 59049 59049
13 177633 177633 176904 176904 176904 176904
14 531441 532170 531441 532170 530712 530712
15 1594323 1594323 1594323 1596510 1594323 1592136
16 4782969 4782969 4780782 4785156 4785156 4780782
17 14344533 14351094 14344533 14351094 14351094 14351094
18 43033599 43046721 43046721 43053282 43046721 43053282
19 129127041 129127041 129146724 129146724 129146724 129146724
20 387420489 387400806 387420489 387400806 387440172 387440172

Examples

Enumeration (OEIS)