Binary words with given trace and subtrace

Here we consider the number $S(n;t,s)$ of length $n$ words $a_1 a_2\ldots a_n$ over the alphabet $\{0,1,\ldots,k-1\}$ with $k=2$ that have trace $t$ and subtrace $s$. The trace of a $k$-ary 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) (1,0) (1,1)
1 101 0
2 112 0
3 133 1
4 264 4
5 6106 10
6 161612 20
7 362828 36
8 725664 64
9 136120136 120
10 256256272 240
11 496528528 496
12 99210561024 1024
13 201620802016 2080
14 409640964032 4160
15 825681288128 8256
16 165121625616384 16384
17 328963264032896 32640
18 655366553665792 65280
19 130816131328131328 130816
20 261632262656262144 262144

Examples

The two binary strings of trace 0, subtrace 0 and length 4 are $\{0000, 1111\}$. The two binary strings of trace 1, subtrace 0 and length 2 are $\{10, 01\}$. The three binary strings of trace 0, subtrace 1 and length 3 are $\{ 011, 101, 110\}$. The four binary strings of trace 1, subtrace 1 and length 4 are $\{0111, 1011, 1101, 1110\}$.

Enumeration (OEIS)