counting different sums of KSubsets over the Unit Circle

Max Alekseyev maxale at gmail.com
Mon Jun 25 07:53:14 CEST 2007


On 6/23/07, wouter meeussen <wouter.meeussen at pandora.be> wrote:
> take the familiar KSubsets of an integer n (say 5) in k parts (say 3):
> {{1,2,3},{1,2,4},{1,2,5},{1,3,4},{1,3,5},{1,4,5},{2,3,4},{2,3,5},{2,4,5},{3,
> 4,5}}
> now, place them on the unit circle as:
>
> {{{E^((2*I)/5*Pi), E^((4*I)/5*Pi), E^((-4*I)/5*Pi)},
> {E^((2*I)/5*Pi), E^((4*I)/5*Pi), E^((-2*I)/5*Pi)}, ...
>
> and add each subset of k complex numbers.
> Now, scan k from 1 to n, and check the count of *different* values you get
> as function of n.
> (Needless to say that the sum of sums adds to zero.)
>
> In 'linguae mathematicae', you get:
> Table[r=Table[Apply[Plus,Map[E^(2*I*Pi#/n)&,KSubsets[Range at n,k],{2}],{1}],{k
> ,n}];Length[Union at Flatten[r]],{n,17}]
>
> {1,3,7,9,31,48,127,144,511,768,2047,2304,8191,12288,32767,36864,131071}

Why do you exclude the case of k=0 ? Exclusion of k=0 looks artificial.
Moreover, the program for counting of distinct sums of all subsets
(including k=0) is simpler:

Table[Length[Union at Apply[Plus,Map[E^(2*I*Pi#/n)&,Subsets[Range at n],{2}],{1}]],{n,17}]

Also, the n-th term of this sequence can be simply described as the
total number of distinct sums of distinct n-th degree roots of 1.

The equality a(n)=2^n for some n means that all such sums are distinct
(as the total number of subsets of the n-th degree roots of 1 is 2^n).

Max

P.S. Alternative PARI/GP code:
{ a(n) = local(S=Set()); forvec(c=vector(n,i,[0,1]),
S=setunion(S,[sum(k=1,n,c[k]*exp(2*Pi*I*k/n))]) ); length(S) }





More information about the SeqFan mailing list