On the addition of residue classes mod p

In this paper we investigate the following question. Let p be a prime, a,, " ', cck distinct non-zero residue classes modp, N a residue class modp. denote Dhe number of solutions of the congruence ela,+... + ekak = N(modp) where the e,,. .. , ek are restricted to the values 0 and 1, What can be said about the function J?(N)? We prove two theorems. THEOREM I. 14 " (X) > 0 if k > 3 (6;~) " ~. THEOREM II. P(N) = 2kp-'(1+o(1)) $ k3pS2-+ 00 as p + co. Theorem I is almost best possible. Put al = ', '2 =-1, a3 = 2, a4 =-2,. .. . ckk = (Lx)k-'[&(k+l)]. Then it follows from an easy calc.ulation that F(S(p-1)) = 0 if k < 2 (p1/2-1). Theorem II is best possible. Define CZ~,. .. , ak as above and assume that p2f3 < k = O(P'/~), Then it follows from our analysis that limp2-kp(0) > 1. p-too In the method of proof the two theorems differ considerably. The proof of Theorem I is elementary, depending entirely on the manipulation of residue classes mBdp, whereas the proof of Theorem II is based on the application of finite Fourier series and simple considerations on diophantine approximations. In an appendix we state various further conjectures which we are not able to prove.