4-ary Lyndon words with given trace and subtrace

A $k$-ary Lyndon word is a string made from the characters $\{0,1,\ldots,k-1\}$. It must be aperiodic (not equal to any of its non-trivial rotations) and be lexicographically least among its rotations. Here we consider the number $L(n;t,s)$ of length $n$ Lyndon words $a_1 a_2 \ldots a_n$ over the alphabet $\{0,1,\ldots,k-1\}$ with $k=4$ that have trace $t$ and subtrace $s$. The trace of a Lyndon word is the sum of its digits mod $k$, i.e., $t = a_1 + a_2 + \cdots + a_n \pmod{k}$. The subtrace is the sum of the products of all $n(n-1)/2$ pairs of digits taken mod $k$, i.e., $s=\sum_{1\leq i\lt j\leq n} a_i a_j$.

(trace,subtrace)
$n$ (0,0) (0,1) (0,2) (0,3) (1,0)
(3,0)
(1,1)
(3,1)
(1,2)
(3,2)
(1,3)
(3,3)
(2,0) (2,1) (2,2) (2,3)
1 1000 1000 1000
2 0001 1010 1000
3 1202 2021 1202
4 1616 4444 4406
5 1116816 8161116 1116816
6 44453640 32533253 45364044
7 169128160128 128169128160 169128160128
8 588448548448 512512512512 576440576440
9 1948170619201706 1948170619201706 1948170619201706
10 6560652864966579 6963614469636144 6579656065286496
11 23133245762304024576 24576230402457623133 23133245762304024576
12 84565901108456590110 87380873808738087380 84820900468448090004
13 317755327680317440327680 317440327680317755327680 317755327680317440327680
14 1198336119866511978241198080 1179648121709711796481217097 1198665119782411980801198336

Examples

The two 4-ary Lyndon words of trace 1, subtrace 2 and length 3 are $\{023, 032\}$. The four 4-ary Lyndon words of trace 3, subtrace 3 and length 4 are $\{0111, 0133, 0313, 0331\}$. The six 4-ary Lyndon words of trace 2, subtrace 3 and length 4 are $\{0123, 0132, 0213, 0231, 0312, 0321\}$.

Enumeration (OEIS)