Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #46 Nov 24 2024 20:47:51
%S 1,3,10,25,126,127,1716,2241,18469,15231,352716,36973,5200300,1799995,
%T 30333601,24331777,1166803110,12247363,17672631900,723276561
%N Number of distinct sums of n complex n-th roots of 1.
%C a(n) == 1 (mod n).
%C Also, a(n) equals the size of the set { f(x) mod Phi_n(x) }, where f(x) runs over the polynomials of degree at most n-1 with nonnegative integer coefficients such that f(1)=n (i.e. the coefficients sum to n), Phi_n(x) is the n-th cyclotomic polynomial. In particular, for prime n, Phi_n(x)=1+x+...+x^(n-1) and thus all f(x) mod Phi_n(x) are distinct, implying that a(n)=binomial(2*n-1,n). - _Max Alekseyev_, Feb 20 2018
%F For prime p, a(p) = binomial(2*p-1,p). - Conjectured by _Robert Israel_, Feb 18 2018; proved by _Max Alekseyev_, Feb 20 2018
%F a(n) = A299807(n,n). - _Max Alekseyev_, Feb 25 2018
%e From _M. F. Hasler_, Feb 18 2018: (Start)
%e For n=2, the n-th roots of unity are U[2] = {-1, 1}, and taking x, y in this set, we can get x + y = -2, 0 or 2.
%e For n=3, the n-th roots of unity are U[3] = {1, w, w^2} where w = exp(2i*Pi/3) = -1/2 + i sqrt(3)/2, and taking x, y, z in this set, we can get x + y + z to be any of the 10 distinct values { 3, 2 + w, 2 + w^2, 1 + 2w, 1 + 2w^2, 0, w - 1, w^2 - 1, 3w, 3w^2 }. (End)
%p nexti:= proc(i,N) local ip,j,k;
%p ip:= i;
%p for k from N to 1 by -1 while i[k]=N-1 do od;
%p if k=0 then return NULL fi;
%p ip[k]:= ip[k]+1;
%p for j from k+1 to N do ip[j]:= ip[k] od;
%p ip
%p end proc:
%p f:= proc(N) local S, i,P,z;
%p S:= {}:
%p i:= <(0$N)>:
%p P:= numtheory:-cyclotomic(N,z);
%p while i <> NULL do
%p S:= S union {rem(add(z^i[k],k=1..N),P,z)};
%p i:= nexti(i,N);
%p od;
%p nops(S);
%p end proc:
%p seq(f(N),N=1..10); # _Robert Israel_, Feb 18 2018
%t a[n_] := (t = Table[Exp[2 k Pi I/n], {k, 0, n - 1}]; b[0] = 1; iter = Table[{b[j], b[j - 1], n}, {j, 1, n}]; msets = Table[Array[b, n], Evaluate[Sequence @@ iter]]; tot = Total /@ (t[[#]] & /@ Flatten[msets, n - 1]) // N; u = Union[tot, SameTest -> (Chop[Abs[#1 - #2]] == 0 &)]; u // Length); Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 10}] (* _Jean-François Alcover_, Feb 19 2018 *)
%o (PARI) a(n,U=vector(n,k,bestappr(exp(2*Pi/n*k*I),5*2^n)),S=[])={forvec(i=vector(n,k,[1,n]),S=setunion(S,[vecsum(vecextract(U,i))]));#S} \\ Not very efficient for n > 8. - _M. F. Hasler_, Feb 18 2018
%Y Cf. A103314, A107754, A107861, A108380, A107848, A107753, A108381.
%K nonn
%O 1,2
%A _David W. Wilson_, Feb 18 2018
%E a(1) through a(11) from _Robert Israel_, Feb 18 2018
%E a(12)-a(13) from _Chai Wah Wu_, Feb 20 2018
%E a(14)-a(20) from _Max Alekseyev_, Feb 22 2018