# Modular arithmetic and elementary symmetric functions

Denote the elementary symmetric functions in $n$ variables by $e_k(x_1, x_2,\dots, x_n)$. In the special case $x_j=j$, simply write $e_k(n)$ for $e_k(1, 2, \dots, n)$. Next, define the sequence
$$a_{+}(n)=\sum_{k\geq0}(-1)^ke_{2k}(n).$$

I am interested in the following:

Question. If $\lambda_n=\frac{3-(-1)^{\lfloor n/2\rfloor}}2$, then is it true that We have $a_{+}(n)\equiv\lambda_{n+1}\mod3?$

It follows that $e_k(n) = \begin{bmatrix} n+1\\ n-k+1\end{bmatrix}$, i.e., unsigned Stirling numbers of first kind.
Now, let $$f_n(x) := \sum_{k\geq 0} e_k(n) x^k = (1+x)(1+2x)\cdots (1+nx).$$ Then $$\sum_{k\geq 0} e_{2k}(n) x^{2k} = \frac{1}{2}(f_n(x)+f_n(-x))$$ and $$a_+(n) = \frac{1}{2}(f_n(I)+f_n(-I)) = \Re f_n(I),$$ where $I$ is the imaginary unit.
Let $r:=n\bmod 3$ and $m:=\lfloor n/3\rfloor$, and so $n=3m+r$. Then $$f_n(x) \equiv ((1+x)(1+2x)(1+0x))^m \prod_{j=1}^r (1+jx) \equiv (1+2x^2)^m \prod_{j=1}^r (1+jx)\pmod{3}.$$ Correspondingly, $$a_+(n) \equiv (-1)^m \prod_{j=1}^r (1+jI) \equiv \begin{cases} (-1)^m &\text{if}\ r=0,1\\ (-1)^{m+1} &\text{if}\ r=2\end{cases} \pmod{3}.$$
This can be combined into $$a_+(n) \equiv (-1)^{\lfloor (n+1)/3\rfloor}\pmod{3}$$ and so $a_+(n)\equiv \lambda_{n+1}\pmod3$ (modulo the typo in the definition of $\lambda_n$).