Denote the [elementary symmetric functions](https://en.wikipedia.org/wiki/Elementary_symmetric_polynomial) 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?$
> 
> 
> 



Modular arithmetic and elementary symmetric functions
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$).


