An interesting result about subset sums

An interesting result about subset sums
Nitu Kitchloo
Lior Pachter
November 27, 1993
Abstract
We consider
P the problem of determining the number of subsets B f1; 2; : : :; ng
such that b2B b k mod n, where k is a residue class mod n (0 < k n). If the
number of such subsets is denoted Nnk then
1 X 2 ns '(s) ( s ):
Nnk =
s ) (k; s)
n sjn
'( (k;s
)
s odd
Here ' denotes the Euler phi function and is the Mobius function. This elaborates
on a result by Erd}os and Heilbronn. We also derive a similar result for nite abelian
groups.
1 Introduction
Let An = f1; 2; : : : ; ng. There have been a number of results in the past about how large a
subset A An has to be so that the sums of the elements of A possess a certain property,
[1], [2], [3]. In particular, Erd}os and Heilbronn [2] proved the following result:
Let n be a positive integer, a1; : : :; ak distinct residue classes mod n, and N a residue
class mod n. Let F (N ; n; a1; : : :; ak ) denote the number of solutions of the congruence
e1a1 + : : : + ek ak N mod n
where e1; : : : ; ek take the values of 0 or 1.
Theorem 1 (Erd}os, Heilbronn) Let ai be nonzero for every i and let p be a prime. Then
F (N ; p; a1; : : : ; ak ) = 2k p?1 (1 + o(1))
if k 3p?2 ! 1 as p ! 1.
1
We consider the related problem of explicitly determining the number of subsets A An
with the property that the sum of the elements of A is congruent to k mod n. Note that this
is equivalent to determining F (k; n; a1; : : :; an) when 0 < k n. This follows if we accept
the convention that the elements of the empty set sum up to 0 mod n. We will denote
F (k; n; a1; : : : ; an) by Nnk .
Clearly Nnk 1. This is because for any n; k, the subset fkg of An has the desired
property. Another subset of An with this property for n 3; k = 0 is the subset B = fx 2
An : gcd(x; n) = 1g. This is a well known result.
2 Calculation of Nnk
Proposition 2 Consider the polynomial Pn (x) dened as follows:
Pn (x) =
n
Y
j =1
(1 + xj ) =
n(n+1)
X
2
r=0
an;r xr :
Let !n = e ni be a primitive nth root of unity. Then
2
n
X
Nnk = n1 !n?kj Pn(!nj ):
j =1
Proof: Notice that each coecient of xr in Pn (x) is equal to the number of subsets of
An that sum to r. Nnk is the sum over the coecients of xr where n divides r ? k. Therefore,
Nnk =
X
:n+k0
an;n+k :
(1)
We will prove the proposition using (1) and the following Lemma:
Lemma 3 Let be a positive integer. Then Pnj=0?1 !nj = 0 when n 6 j and n when nj.
Proof: Consider the equation xn ? 1 = 0. We factor this as
(x ? 1)(1 + x + x2 + : : : + xn?2 + xn?1 ) = 0:
Note that !n is a root of xn ? 1 for every . Hence it is a root of the second factor if and
only if !n ? 1 6= 0. The result follows.
Now consider
nn
X
an;k !njk :
Pn (!nj ) =
( +1)
2
k=0
2
Then
n
X
j =1
n
X
!n?kj Pn (!nj ) =
j =1
!n?kj
n(n+1)
X
2
an;r!nrj
r=0
n
X
n(n+1)
X
2
an;r !n(r?k)j
r=0
X j=1
= n
an;n+k
=
:n+k0
n(Nnk ):
=
is odd and 0 otherwise. Here (n; j ) denotes the g.c.d.
Proposition 4 Pn (!nj ) = 2(n;j) if (j;nn )
of n; j (1 j n).
Proof: We shall rst prove two technical lemmas and then combine them to obtain the
required result.
Lemma 5
Proof: Note that
Pn (!nj ) = [P n;jn (! n;jn )](n;j):
(
Pn (!nj ) =
=
Now !n(n;j) = ! n;jn . Hence
(
)
Pn (!nj ) =
j
n;j)
! ((n;j
n
)
)
n
Y
(
)
n;j)
(1 + [!nj ]r n;j )
(
(
r=1
n
Y
r=1
)
jr
(1 + [!n(n;j)] n;j ):
n
Y
(
n;j r
(1 + [! n;j
n ] ):
(
r=1
j
)
(
)
)
Furthermore, ( (n;jj ) ; (n;jn ) ) = 1 so
is a primitive (n;jn ) th root of unity. Therefore as r
ranges from 1 to n, the factors repeat themselves (n; j ) times, i.e.
Pn (!nj ) = [
n
n;j
Y
(
)
r=1
j
n;j r (n;j )
n ] )]
(1 + [! n;j
(
(
j
)
)
n;j (n;j )
= [P n;jn (! n;j
:
n )]
(
(
)
)
(
)
j
n;j
Recalling that ( (n;jj ) ; (n;jn ) ) = 1 we notice that P n;jn (! n;j
n ) is just a permutation of the factors
in P n;jn (! n;jn ). Hence,
j
n;j
n (! n )
P n;jn (! n;j
n ) = P n;j
n;j
(
(
(
)
(
)
(
)
)
)
(
)
(
)
(
)
(
3
)
(
)
which gives the result
Pn (!nj ) = [P n;jn (! n;jn )](n;j):
(
)
(
)
Lemma 6 Pr (!r ) = 1 ? (?1)r :
Proof: Consider the polynomial xr ? 1. Then 1; !r ; !r2; : : :; !rr?1 are the distinct r roots
of this polynomial. Thus
xr ? 1 = (x ? 1)(x ? !r )(x ? !r2) (x ? !rr?1):
Substituting x = ?1 we get
((?1)r ? 1) = (?1)r (1 + !r )(1 + !r2) (1 + !rr ):
i.e. 1 ? (?1)r = Pk (!r ). Now
Pn (!nj ) = [P n;jn (! n;jn )](n;j)
n
= [1 ? (?1) n;j ](n;j):
This is equal to 2(n;j) when (n;jn ) is odd and 0 otherwise.
Proposition 7 Suppose tjn, = nt . Then
X ?ktx '() X x
! k; :
!n = '
(
)
(k;) x2Z
x2Z
(
)
(
)
(
)
(k; )
(
)
Proof: First note that !ntx = !x. Also x and ?x are both elements of Z . Therefore
X
(
k x
)
(
)
x2Z
;k
Now rewrite !kx as ! ;k
. Hence
X
x2Z
X
!n?ktx =
!kx =
x2Z
X
x2Z
!kx:
(
k x
)
(
)
;k
! ;k
X ;kk x
! :
= '( )
'( (k;) ) x2Z ;k
(
)
(
)
k;)
(
This is because
reduces to
'()
)
'( (k;
)
summands are identical 8x 2 Z . Finally, since ( (;kk ) ; (;k ) ) = 1 this
'() X !x
'( (k; ) ) x2Z k;
(
k;)
(
which completes the proof of the proposition.
4
)
Proposition 8
X
t2Zn
!nt = (n):
Proof: Let n (x) denote the nth cyclotomic polynomial. Then Pt2Zn !nt is just the
negative of the coecient of x'(n)?1 in n (x).
Claim 9 n(x) = d(xm) where n = dm and d is the product of all the distinct prime
factors of n.
Proof: It is well knownQ that nn (x) = Qrjn(x nr ? 1)(r). For a proof of this result see [4],
page 353. Now d (xm) = sjd (x s ? 1)(s) . If sjn and s > d then s is divisible by the square
of some prime and so (s) = 0. Hence the claim.
Claim 10 pn(x) = nn((xxp)) if p is a prime that does not divide n.
Proof: Once again we use the fact that n (x) = Qrjn(x nr ? 1)(r). In our case we have
Y npr
pn (x) =
(x ? 1)(r)
rjpn
Y
Y npr
np
(x r ? 1)(r)
(x ? 1)(r)
rjpn:p=jr
rjpn:pjr
Y
Y npt
n
= (x ? 1)(t) (x s ? 1)(sp):
=
sjn
tjn
However is a multiplicative function hence (sp) = ?(s) so
pn(x) = (n (xp))(n (x))?1:
If p2jn for some
prime p then by Claim 9 the coecient of x'(n)?1 in n(x) is 0. So
Q
assume that n = Pmi=1 pi , where the pi's are distinct. We now use induction on m and Claim
10 to obtain that t2Zn !nt = (n).
Theorem 11
X
Nnk = n1 2 ns ''( (ss ) ) ( (k;ss) ):
(k;s)
sjn
s odd
Proof: Using Proposition 2 we obtain that
n
X
Nnk = n1 !n?kj Pn(!nj ):
j =1
5
Now we use Proposition 4 to obtain
X ?kj (j;n)
!n 2 :
Nnk = n1
Now let (j; n) = t. Then
Zn ,
n odd
j : (j;n
)
1
0
B X t X ?ktxCC
Nnk = n1 B
@ n 2 !n A
tjn: t odd x2Z n
t
since as x ranges over t tx ranges over the elements r such that (r; n) = t. Applying
Proposition 10 we obtain
0
1
B
B
X t '( nt ) X x CCC
1
B
k
Nn = n B
! ntn C
2
:
n
B
t
n
k; t C
'
(
)
@tjn: t odd
A
(k; nt ) x2Z nt
(
)
k; nt )
(
Finally, we use Proposition 7 to conclude that
n
X t '( nt )
2
Nnk = n1
n ( t n ):
tjn: nt odd '( (k;tnt ) ) (k; t )
Substituting s = nt this reduces to
X
Nnk = n1 2 ns ''( (ss ) ) ( (k;ss) ):
(k;s)
sjn
s odd
For the case when k = n this formula can easily be simplied to obtain
X
Nnn = n1 2 ns '(s):
sjn
s odd
3 A Theorem About Finite Abelian Groups
A natural generalization of the problem discussed in the previous section is a similar problem
for nite abelian groups. That is, if G is a nite abelian group of order n, we want to calculate
the number of subsets of G whose elements sum up to the identity element (0) of G.
For the purposes of this section we will use the following notation: Let S denote a k-tuple
of numbers, i.e. S = (s1; s2; : : :; sk ). Given two k-tuples J and N dene
X
0<J N
jX
=n j X
=n
jkX
=nk
=
:
1
1
2
2
j1 =1 j2 =1
6
jk =1
Will will denote the number of subsets of a nite abelian group G whose elements sum up
to 0 by NG .
Theorem 12 Let G = Zn L Zn L :j:n: L Znkj ben a nite abelian group of order n = n1n2 nk .
Given a k-tuple J dene TJ =g.c.d.( n ; : : :; nkk ) and let N = (n1 ; n2 ; : : :; nk ). Then
X
n
[1 ? (?1) n;TJ ](n;TJ ):
NG = n1
0<J N
We shall prove this theorem using the same ideas as before.
Proposition 13 Consider the polynomial
Y
X
F (x1; x2; : : :; xk ) =
(1 + xs1 xs2 xskk ) = ax1 x2 xk k :
0<S N
Then
X
NG = n1
F (!nj ; : : :; !njkk ):
0<J N
2
1
1
1
(
1
)
2
1
2
1
1
Proof: The proof is identical to that of Proposition 2.
Proposition 14
n
F (!nj ; : : :; !njkk ) = [1 ? (?1) n;TJ ](n;TJ ):
1
1
Proof: Note that
!njiisi
(
)
ji sin
ni
= !n . Therefore
Y
(1 + !nj s !nj s !njkksk )
F (!nj ; : : : ; !njkk ) =
0<SN
P jisin
Y
=
(1 + !n i ni ):
0<SN
Consider the exponent in one factor of the above product for a xed S , i.e.
X
X jin
si( n ) = TJ ( si( njiTn )):
i
i J
i
i
1 1
1
1
1
2 2
2
Claim 15 For every m (0 m n) there exists a k-tuple S such that
X
TJ ( si( njiTn )) TJ m mod n:
i J
i
7
Proof: Note that g.c.d.( nj TnJ ; : : :; njkkTnJ ) = 1 and therefore for any integer m there exists
si 2 Z such that
X
1
1
m=
Equivalently,
siji n :
ni TJ
i
X siji n
):
i ni TJ
Now note that if any si is replaced by si + ni in the above equation then we still have equality
(mod n). Thus every si can be chosen to be less than ni.
Therefore by the above claim we obtain
P jisin
nY
?1
Y
i ni
(1 + !nTJ m)
) =
(1 + !n
m=0
0<SN
= Pn (!nTJ )
n
= [1 ? (?1) n;TJ ](n;TJ )
TJ m = TJ (
(
)
and so we have proved the proposition.
Proof (main theorem): The theorem now follows immediately by combining Propositions
13 and 14:
X
NG = n1
F (!nj ; : : :; !njkk )
0<J N
X
n
[1 ? (?1) n;TJ ](n;TJ ):
= n1
0<J N
1
1
(
)
4 Further Results
n where 0 <
Another problem related to the calculation of Nnk is the calculation of Nn;m
n(n+1) . N n is dened to be the number of subsets B f1; 2; : : : ; ng such that
m
<
n;m
P b 2 0 mod m
. We Remark that N n is easily obtained when mjn.
b2B
n;m
Proposition 16 Let n; m be positive integers with mjn. Then
n = 1 X 2 ns '(s):
Nn;m
m
sjm
s odd
Proof: Using Lemma 3 and the same proof as given in Proposition 2 we obtain that:
m
n = 1 X P (! j ):
Nn;m
n m
m
j =1
8
Now 1+(!mj )m+i = 1+(
!mj )i so the factors in Pn(!mj ) repeat themselves mn times. Therefore
n
Pn (!mj ) = [Pm(!mj )] m . Now we proceed as before to get
n = 1 X 2 ns '(s):
Nn;m
m sjm
s odd
Snevily, [5] has proposed the following conjecture:
n(n+1)
n g
Conjecture 17 The sequence fNn;m
m=1 is monotonically decreasing.
2
We also mention an interesting connection between our problem and two other counting
problems in combinatorics. Let Cn denote the number of circular sequences of 0's and
1's, where two sequences obtained by a rotation are considered the same. This problem is
discussed in [6], page 75. The solution is
X
Cn = n1 '(t)2 nt :
tjn
This is indentical in form to our formula for Nnn except that in our case we sum over all tjn
where t is odd. Another related problem is the calculation of the number of monic irreducible
polynomials of degree n over a eld of q elements where q is prime ([6], page 116). If the
number of such polynomials is denoted Mnq then
X
Mnq = n1 (d)q nd :
djn
For q = 2 this has the exact same form as our formula for Nnk where (k; n) = 1. Once again,
the only dierence is that our sum is over djn such that d is odd.
References
[1] N. Alon and G. Freiman, On sums of a subset of a set of integers, Combinatorica, 8(4)
(1988), 297-306.
[2] P. Erd}os and H. Heilbronn, On the addition of residue classes mod p, Acta Arithmetica,
9 (1964), 149-159.
[3] J. Olson, An additive theorem modulo p, J. Combinatorial Theory, 5 (1968), 45-52.
[4] R. Dean, Classical Abstract Algebra, Harper and Row, Publishers, New York, 1990.
[5] H. Snevily, personal communication.
[6] J.H. van Lint and R.M. Wilson, A Course in Combinatorics, Cambridge University Press
1992.
9
Nitu Kitchloo
Lior Pachter
Department of Mathematics
MIT
Cambridge, MA
Department of Mathematics
Caltech
Pasadena, CA
10