Solution: In what follows all congruences are modulo 13. We first prove that
x=0∑12xk≡0, for 0≤k<12.
The case k=0 is easy to prove, so suppose k>0. Let g be a primitive root modulo 13; hence g,2g,…,12g is some permutation of 1,2,…,12. Therefore
x=0∑12xk≡x=0∑12(gx)k=gkx=0∑12xk,
since gk=1, it must be that ∑x=012xk=0.
Let S={(x1,…,xn)∣0≤xi≤12}. It suffices to prove that the number of n-tuples (x1,…,xn)∈S with f(x1,…,xn)=0 is a multiple of 13, because ∣S∣=13n is a multiple of 13.
Consider the sum
(x1,…,xn)∈S∑(f(x1,…,xn))12,
this sum counts the number of n-tuples (x1,…,xn)∈S with f(x1,…,xn)=0, this is because Fermat's Little Theorem says
(f(x1,…,xn))12≡{1,0,if f(x1,…,xn)=0,if f(x1,…,xn)=0.
On the other hand we can expand (f(x1,…,xn))12 to obtain
(f(x1,…,xn))12=j=1∑Ncji=1∏nxieji,
where N,cj,eji are integers. Because f is a polynomial of degree less than n, for every j we have ej1+ej2+⋯+ejn<12n, so for every j there exists i such that eji<12. Hence we have
(x1,…,xn)∈S∑cji=1∏nxieji=cji=1∏nx=0∑12xeji≡0,
because one of the sums in the product is 0. Therefore
(x1,…,xn)∈S∑(f(x1,…,xn))12=(x1,…,xn)∈S∑j=1∑Ncji=1∏nxieji≡0,
hence the number of n-tuples (x1,…,xn) such that f(x1,…,xn)≡0mod13 must be a multiple of 13, as claimed.