Given two anticommuting elements, $A$ and $B$, I aim at evaluating the sum over all strings of length $n$ multiplying exactly $k$ elements $A$ and $n-k$ elements $B$ (as we know, there are $\binom{n}{k}$ strings in total). In maths terms, I want to evaluate the constant $c$ in the expression
\begin{align*} c\cdot A^k \, B^{n-k} &= \text{sum over all strings containing $k$ As and $n-k$ Bs}\\ &=\sum_{\sigma\in S_n} \frac{1}{k!(n-k)!}\sigma(A^k \, B^{n-k}), \end{align*} where $\sigma$ is a permutation in $S_n$.
The intermediate step (but maybe not necessary?) would be to calculate $p(\sigma)$ for \begin{equation*} p(\sigma) \cdot A^k \, B^{n-k} = \sigma(A^k \, B^{n-k}) \end{equation*} which should be either $1$ or $-1$ depending on whether the number of adjacent transposition needed to turn the ordered string $A^k \, B^{n-k}$ into its permuted version under $\sigma$ is even or odd.
Is there a formula for $c$ (and $p$) in terms of $n$ and $k$?
Let $C(n,k)$ denote the summation of all strings of $k$ $A$'s and $n-k$ $B$'s, so that $C(n,k)=c(n,k)A^kB^{n-k}$. Since $$ \begin{align} c(n,k)A^kB^{n-k}=C(n,k) &=A\cdot C(n-1,k-1)+B\cdot C(n-1,k)\\ &= A\cdot c(n-1,k-1) A^{k-1}B^{n-k} +B\cdot c(n-1,k)\cdot A^{k}B^{n-k-1}\\ &=c(n-1,k-1) A^{k}B^{n-k} + c(n-1,k)\color{red}{(-1)^k}\cdot A^{k}B^{n-k}\\ &=[c(n-1,k-1)+(-1)^k c(n-1,k)] A^{k}B^{n-k} \end{align} $$ We conclude that $$ c(n,k)=c(n-1,k-1)+(-1)^k c(n-1,k), $$ so $c(n,k)$ satisfies a twisted version of Pascal's rule. Using this, together with the base cases $c(0,k)=1[k=0]$, you can prove by induction that $$ c(n,k)=\begin{cases} \binom{\lfloor n/2\rfloor }{\lfloor k/2\rfloor } & \text{if $n$ is odd or $k$ is even} \\ 0 & \text{if $n$ is even and $k$ is odd} \end{cases} $$ Putting this triangle of integers into OEIS, we find the entry https://oeis.org/A051159, which also gives this description for $c(n,k)$:
That is, $c(n,k)=\binom{n}{k}_{-1}$.