Introduce the sequence (this is [A047781 on OEIS](https://oeis.org/A047781))
$$t\_n=\sum\_{k=0}^{n-1}\binom{n-1}k\binom{n+k}k$$
and denote the set $T(ij)=\{n\in\mathbb{N}: \text{the ternary digits of $n$ contain $i$ or $j$ only}\}$.



> 
> **QUESTION.** Is this true modulo $3$?
> $$t\_n\equiv\_3\begin{cases} 1 \qquad \text{if $\lfloor\frac{n}2\rfloor\in T(01)$} \\
> 0 \qquad \text{otherwise}. \end{cases}$$
> 
> 
> 



Modulo $3$ calculations for a binomial-sum sequence
The answer is Yes.


The generating function for $t\_n$ is
$$\sum\_{n\geq 0} t\_n x^n = \frac14\big(\frac{1+x}{\sqrt{1-6x+x^2}}-1\big).$$
Correspondingly,
$$\sum\_{n\geq 0} t\_n x^n \equiv \frac{1+x}{\sqrt{1+x^2}}-1 \pmod{3}.$$
It follows that for $n>0$,
$$t\_n \equiv \binom{-1/2}{\lfloor n/2\rfloor}\equiv (-1)^{\lfloor n/2\rfloor}\binom{2\lfloor n/2\rfloor}{\lfloor n/2\rfloor}\pmod{3},$$
from where [Lucas' theorem](https://en.wikipedia.org/wiki/Lucas%27s_theorem) gives the desired result.


