TITLE: Determining when a certain binomial sum vanishes
QUESTION [7 upvotes]: Consider the following sum of signed binomial coefficients: 
$$S_{n,a,p} = \sum_{i \equiv a \mod p} \binom{n}{i}(-1)^i$$
($n$ is a positive integer, $p$ is an odd prime, $a$  is between $0$ and $p-1$.)
I want to understand when it is zero, i.e., for any value of $p$ and $a$ to be given the set of $n$ for which $S_{n,a,p} = 0$. I have 4 observations:

Using the generating function $(1-x)^{n}$, one finds that $pS_{n,a,p} = \sum_{i=0}^{p-1} (1-\omega_{p}^{i})^{n} \omega_p^{-ia}$, where $\omega_p$ is a primitive root of unity of order $p$, say $e^{2 \pi i /p}$. This creature is actually the trace of $(1-\omega_{p})^{n} \omega_p^{-a}$, as an element of $\mathbb{Q}(\omega_p) / \mathbb{Q}$.
Using Lucas's Theorem, it is a technical manner to show that this sum is divisible by $p$ when $n \ge p$. I suspect that perhaps considering it mod higher powers of $p$ will help to solve this problem, or maybe even p-adic methods. Equation 1.12 here contains a generalization of my observation, and it has a short nice proof.
When $n=2a+pk$ where $k$ is odd, the symmetry $\binom{n}{i}=\binom{n}{n-i}$ shows that $S_{n,a,p} = 0$. I suspect that this is the only case.
When $p=3$, $S_{n,a,3}$ factors as $(1-\omega_3)^n \omega_{3}^{2a} (1+(-\omega_{3}^{2})^{n}\omega_{3}^{2a})$, and from this form it can be shown that the third observation holds.

I don't know if the algebraic formulation helps.
EDIT: The following more specific question is also of interest for me-
Do we have either $S_{n,0,p} \neq 0$ or $S_{n,1,p} \neq 0$ for any $n$ and odd prime $p$? In other words, solving this for $a=0,1$ interests me.

REPLY [4 votes]: This is bizarre, I have a paper that I work on during very rainy days on this topic. What you have is a difference of two periodic binomial coefficients of period $2p$. I use the notation
$$PC_q(n,r,k)=\sum_{j \in \mathbb Z} C_q(n,k+rj)$$
where $C_q(n,k)$ denotes the exponent of $x^k$ in $(1+x+\cdots+x^{q-1})^n$. In your particular instance we're interested in the function up to a sign change
$$\Gamma_2(n,2p,p,k)=PC_2(n,2p,k)-PC_2(n,2p,k+p).$$
I've proved the following result, in a paper that I can send you, although it's in a rough state. The function $\Gamma_q(n,r,j,k)$ is positive on the interval 
$$\left(\frac{N-r+j}{2},\frac{N+j}{2}\right)$$
if $q>1$, $r>2(q-1)$ and $n\geq r/(q-1)+1$ where $N=n(q-1)$. The function $\Gamma_q(n,r,j,\cdot)$ is anti-symmetric so it follows that it's negative on the interval 
$$\left(\frac{N+j}{2},\frac{N+j+r}{2}\right).$$
In your case for sufficiently large $n$ you'll have that $\Gamma_2(n,2p,p,k)$ will be zero if $(n+p)/2$ is an integer and it will be zero only at integers congruent to $(n+p)/2$ and $(n-p)/2$. 
They behave a bit badly when $n$ is less than that and end up being zero quite a bit of the time. The behavior stabilizes as $n$ grows so I've been more concerned about that, but I have some notes about the behavior for small $n$ laying around somewhere. The proof of this result is fairly painful, the main point is determining when $PC_q(n,r,k)$ is increasing and decreasing from which the $\Gamma_q$ result follows easily. 
Periodic generalized binomial coefficients were first studied by  Ramus [1], although he was only concerned binomial coefficients he gave a closed form. The next bit of work on them came from Hoggatt who gave a formula for PC_q(n,r,k). Then my adviser ran into them because the Hilbert Series of the associated graded ring of the ring of functions in $n$ variables over a finite field of order $q$ is $(1+x+\cdots+x^{q-1})^n$. So they naturally showed up while we were computing the dimensions of some homologies associated to certain elements [3]. For further references on generalized binomial coefficients you can refer to Bondarenko's book [4]. 
I am very interested though in what context you found them. 
Bibliography - [2] and [4] may be found on the fibonacci quarterlies website, [3] is available on mine or my advisers website. 
[1] C. Ramus, Solution generale d'un probleme d'analyse combinatoire, J. Reine Ang. Math. 11
(1834), 352-55
[2] V. E. Hoggatt, G. L. Alexanderson. Sums of partition sets in generalized Pascal triangles. I. Fibonacci Quart. 14 (1976), no. 2, 117-125
[3] T. Hodges, J Schlather, The degree of regularity of a quadratic polynomial,  Journal of Pure and Applied Algebra, Volume 217, Issue 2, February 2013, Pages 207-217,2013
[4] Bondarenko BA (1993) Generalized Pascal triangles and pyramids, their fractals, graphs and applications. Bollinger RC, translator and editor. Santa Clara, California: The Fibonacci Association. 190 p.
Note [2]: As far as I can tell the second paper they apparently intended to write was never finished. For reference Hoggatt died in 1980. Although Hoggatt did have a graduate student who wrote a master's thesis on the topic, I checked it out on inter-library loan but didn't find much of anything useful in it.