cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 21 results. Next

A107861 Number of distinct values taken by the sums of all subsets of the n-th roots of unity.

Original entry on oeis.org

2, 3, 7, 9, 31, 19, 127, 81, 343, 211, 2047, 361, 8191, 2059, 14221, 6561, 131071, 6859, 524287, 44521, 778765, 175099, 8388607, 130321, 28629151, 1586131, 40353607, 4239481, 536870911, 1360291, 2147483647, 43046721
Offset: 1

Views

Author

T. D. Noe, May 25 2005

Keywords

Comments

Note that a(6)=19, a(12)=19^2 and a(18)=19^3. Similarly, a(10)=211 and a(20)=211^2. For prime n, a(n)=2^n-1. For powers of 2, we have a(2^n)=3^(2^(n-1)). It appears that David W. Wilson's conjectured formula for A103314 may apply to this sequence also. Observe that due to symmetry, n divides a(n)-1.
Definition edited by N. J. A. Sloane, Apr 09 2020. The old definition was "Number of unique values in the sums of all subsets of the n-th roots of unity".

Examples

			a(1)=2 as there are two distinct sums: the sum of the empty subset of roots is 0, and the sum of {1} is 1.
		

Crossrefs

Cf. A103314 (number of subsets of the n-th roots of unity summing to zero).

Programs

  • PARI
    { a(n) = my(S=Set()); forvec(c=vector(n,i,[0,1]), S=setunion(S,[Pol(c)%polcyclo(n)])); #S } /* Max Alekseyev, Jun 25 2007 */

Extensions

a(1) corrected by Max Alekseyev, Jun 25 2007
a(21)-a(32) from Max Alekseyev, Sep 07 2007

A108380 Least number of distinct n-th roots of unity summing to the smallest possible nonzero magnitude.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 3, 2, 3, 5, 5, 6, 6, 4, 5, 5, 5, 7, 7, 10, 5, 8, 7, 12, 7, 10, 9, 14, 13, 11, 7, 14, 11, 17, 9, 18, 14, 18, 9, 19, 12, 17, 15, 14, 14, 22, 15, 16, 20, 20, 17, 18, 22, 23, 17, 24, 19, 26, 21, 29, 18, 26, 19, 26, 31, 30, 27, 31, 17, 32, 23, 34
Offset: 1

Views

Author

T. D. Noe, Jun 01 2005, extended Jun 04 2005

Keywords

Comments

Myerson writes about the unsolved problem of finding a good lower bound on the least magnitude as a function of n. Note that a(n)2 because the sum of all n-th roots of unity is 0.

Examples

			a(8)=3 because the least nonzero magnitude is sqrt(2)-1, which is the sum of three 8th roots of unity.
		

Crossrefs

Cf. A103314 (number of subsets of the n-th roots of unity summing to zero).

A322366 Number of integers k in {0,1,...,n} such that k identical test tubes can be balanced in a centrifuge with n equally spaced holes.

Original entry on oeis.org

1, 0, 2, 2, 3, 2, 5, 2, 5, 4, 7, 2, 11, 2, 9, 8, 9, 2, 17, 2, 17, 10, 13, 2, 23, 6, 15, 10, 23, 2, 29, 2, 17, 14, 19, 12, 35, 2, 21, 16, 37, 2, 41, 2, 35, 38, 25, 2, 47, 8, 47, 20, 41, 2, 53, 16, 51, 22, 31, 2, 59, 2, 33, 52, 33, 18, 65, 2, 53, 26, 67, 2, 71, 2, 39, 68, 59, 18, 77, 2, 77, 28, 43, 2, 83, 22, 45, 32, 79
Offset: 0

Views

Author

Alois P. Heinz, Dec 04 2018

Keywords

Comments

Numbers where a(n) + A000010(n) != n + 1: A102467. - Robert G. Wilson v, Aug 23 2021

Examples

			a(6) = |{0,2,3,4,6}| = 5.
a(9) = |{0,3,6,9}| = 4.
a(10) = |{0,2,4,5,6,8,10}| = 7.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local f, b; f, b:=
           map(i-> i[1], ifactors(n)[2]),
           proc(m, i) option remember; m=0 or i>0 and
            (b(m, i-1) or f[i]<=m and b(m-f[i], i))
           end; forget(b); (t-> add(
          `if`(b(j, t) and b(n-j, t), 1, 0), j=0..n))(nops(f))
        end:
    seq(a(n), n=0..100);
  • Mathematica
    $RecursionLimit = 4096;
    a[1] = 0;
    a[n_] := a[n] = Module[{f, b}, f = FactorInteger[n][[All, 1]];
         b[m_, i_] := b[m, i] = m == 0 || i > 0 &&
         (b[m, i - 1] || f[[i]] <= m && b[m - f[[i]], i]);
         With[{t = Length[f]}, Sum[
         If[b[j, t] && b[n - j, t], 1, 0], {j, 0, n}]]];
    Table[a[n], {n, 0, 1000}] (* Jean-François Alcover, Dec 13 2018, after Alois P. Heinz, corrected and updated Aug 07 2021 *)
    f[n_] := Block[{c = 2, k = 2, p = First@# & /@ FactorInteger@ n}, While[k < n, If[ IntegerPartitions[k, All, p, 1] != {} && IntegerPartitions[n - k, All, p, 1] != {}, c++]; k++]; c]; f[0] = 1; f[1] = 0; Array[f, 75] (* Robert G. Wilson v, Aug 22 2021 *)

Formula

a(n) = |{ k : k and n-k can be written as a sum of prime factors of n }|.
a(n) = 2 <=> n is prime (A000040).
a(n) >= n-1 <=> n in {1,2,3,4} union { A008588 }.
a(n) = (n+4)/2 <=> n in { A100484 } minus { 4 }.
a(n) = (n+9)/3 <=> n in { A001748 } minus { 9 }.
a(n) = (n+25)/5 <=> n in { A001750 } minus { 25 }.
a(n) = (n+49)/7 <=> n in { A272470 } minus { 49 }.
a(n^2) = n+1 <=> n = 0 or n is prime <=> n in { A182986 }.
a(A001248(n)) = A008864(n).
a(n) is odd <=> n in { A163300 }.
a(n) is even <=> n in { A004280 }.

A108381 Number of distinct magnitudes of the nonzero sums of distinct n-th roots of unity.

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 8, 9, 16, 17, 62, 23, 186, 95, 280, 240, 1963, 225, 6830, 1091
Offset: 1

Views

Author

T. D. Noe, Jun 01 2005

Keywords

Comments

There are 2^n sums of the n-th roots of unity.

Examples

			a(4)=2 because the nonzero sums of 4th roots of unity have magnitude 1 or sqrt(2).
		

Crossrefs

Cf. A103314 (number of subsets of the n-th roots of unity summing to zero).

A299807 Rectangular array read by antidiagonals: T(n,k) is the number of distinct sums of k complex n-th roots of 1, n >= 1, k >= 0.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 9, 10, 5, 1, 1, 6, 15, 16, 15, 6, 1, 1, 7, 19, 35, 25, 21, 7, 1, 1, 8, 28, 37, 70, 36, 28, 8, 1, 1, 9, 33, 84, 61, 126, 49, 36, 9, 1, 1, 10, 45, 96, 210, 91, 210, 64, 45, 10, 1, 1, 11, 51, 163, 225, 462, 127, 330, 81, 55, 11, 1, 1, 12, 66, 180, 477, 456, 924, 169, 495, 100, 66
Offset: 1

Views

Author

Max Alekseyev, Feb 24 2018

Keywords

Examples

			Array starts:
  n=1:  1,  1,  1,   1,   1,    1,    1,    1,     1,     1,     1, ...
  n=2:  1,  2,  3,   4,   5,    6,    7,    8,     9,    10,    11, ...
  n=3:  1,  3,  6,  10,  15,   21,   28,   36,    45,    55,    66, ...
  n=4:  1,  4,  9,  16,  25,   36,   49,   64,    81,   100,   121, ...
  n=5:  1,  5, 15,  35,  70,  126,  210,  330,   495,   715,  1001, ...
  n=6:  1,  6, 19,  37,  61,   91,  127,  169,   217,   271,   331, ...
  n=7:  1,  7, 28,  84, 210,  462,  924, 1716,  3003,  5005,  8008, ...
  n=8:  1,  8, 33,  96, 225,  456,  833, 1408,  2241,  3400,  4961, ...
  n=9:  1,  9, 45, 163, 477, 1197, 2674, 5454, 10341, 18469, 31383, ...
  n=10: 1, 10, 51, 180, 501, 1131, 2221, 3951,  6531, 10201, 15231, ...
  ...
		

Crossrefs

Rows: A000012 (n=1), A000027 (n=2), A000217 (n=3), A000290 (n=4), A000332 (n=5), A354343 (n=6), A000579 (n=7), A014820 (n=8).
Columns: A000012 (k=0), A000027 (k=1), A031940 (k=2).
Diagonal: A299754 (n=k).

Formula

From Chai Wah Wu, May 28 2018: (Start)
The following are all conjectures.
For m >= 0, the 2^(m+1)-th row are the figurate numbers based on the 2^m-dimensional regular convex polytope with g.f.: (1+x)^(2^m-1)/(1-x)^(2^m+1).
For p prime, the n=p row corresponds to binomial(k+p-1,p-1) for k = 0,1,2,3,..., which is the maximum possible (i.e., the number of combinations with repetitions of k choices from p categories) with g.f.: 1/(1-x)^p.
(End)

Extensions

Row 6 corrected by Max Alekseyev, Aug 14 2022

A070894 Number of nonempty subsets of the set of vertices of a regular n-gon in the plane such that their center of gravity is the center of the polygon.

Original entry on oeis.org

1, 1, 3, 1, 9, 1, 15, 7, 33, 1, 99, 1, 129, 37, 255, 1, 999, 1, 1155, 133, 2049, 1, 9999, 31, 8193, 511, 16899, 1, 146853, 1, 65535, 2053, 131073, 157, 999999, 1, 524289, 8197, 1336335, 1, 11680389, 1, 4202499, 54871, 8388609, 1, 99999999, 127, 45435423, 131077
Offset: 2

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), May 24 2002

Keywords

Crossrefs

This is A103314(n) - 1: see that entry for much more information.

Extensions

Edited by N. J. A. Sloane Jan 19 2008 at the suggestion of Max Alekseyev and M. F. Hasler.

A108417 Number of subsets of the n-th roots of 1 with absolute value of sum = 1.

Original entry on oeis.org

0, 1, 2, 6, 8, 10, 36, 14, 64, 72, 180, 22, 720, 26, 924, 600, 2048, 34, 10800, 38, 12240, 2856, 22572, 46, 144000
Offset: 0

Views

Author

Wouter Meeussen, Jun 02 2005

Keywords

Comments

a(n) is divisible by n (rotation symmetry). a(n)/n differs from A107754 by a factor of 2 for odd n.

Crossrefs

Row sums of A108416.

Programs

  • Mathematica
    <
    				

A299754 Number of distinct sums of n complex n-th roots of 1.

Original entry on oeis.org

1, 3, 10, 25, 126, 127, 1716, 2241, 18469, 15231, 352716, 36973, 5200300, 1799995, 30333601, 24331777, 1166803110, 12247363, 17672631900, 723276561
Offset: 1

Views

Author

David W. Wilson, Feb 18 2018

Keywords

Comments

a(n) == 1 (mod n).
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

Examples

			From _M. F. Hasler_, Feb 18 2018: (Start)
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.
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)
		

Crossrefs

Programs

  • Maple
    nexti:= proc(i,N) local ip,j,k;
      ip:= i;
      for k from N to 1 by -1 while i[k]=N-1 do od;
      if k=0 then return NULL fi;
      ip[k]:= ip[k]+1;
      for j from k+1 to N do ip[j]:= ip[k] od;
      ip
    end proc:
    f:= proc(N) local S, i,P,z;
      S:= {}:
      i:= <(0$N)>:
      P:= numtheory:-cyclotomic(N,z);
      while i <> NULL do
        S:= S union {rem(add(z^i[k],k=1..N),P,z)};
        i:= nexti(i,N);
      od;
      nops(S);
    end proc:
    seq(f(N),N=1..10); # Robert Israel, Feb 18 2018
  • Mathematica
    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 *)
  • 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

Formula

For prime p, a(p) = binomial(2*p-1,p). - Conjectured by Robert Israel, Feb 18 2018; proved by Max Alekseyev, Feb 20 2018
a(n) = A299807(n,n). - Max Alekseyev, Feb 25 2018

Extensions

a(1) through a(11) from Robert Israel, Feb 18 2018
a(12)-a(13) from Chai Wah Wu, Feb 20 2018
a(14)-a(20) from Max Alekseyev, Feb 22 2018

A108416 Triangle read by rows: T(n,k) counts the k-subsets of the n-th roots of 1 with absolute value of sum=1.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 0, 5, 0, 0, 6, 6, 12, 0, 7, 0, 0, 0, 8, 0, 24, 0, 0, 9, 9, 0, 18, 0, 10, 0, 40, 10, 60, 0, 11, 0, 0, 0, 0, 0, 12, 12, 60, 72, 144, 120, 0, 13, 0, 0, 0, 0, 0, 0, 14, 0, 84, 0, 210, 14, 280, 0, 15, 15, 0, 75, 60, 30, 105, 0, 16, 0, 112, 0, 336, 0, 560, 0, 0, 17, 0, 0
Offset: 0

Views

Author

Wouter Meeussen, Jun 02 2005

Keywords

Comments

Row n is divisible by n (rotation symmetry).
Row sums: A108417.

Examples

			T(6,2)=6, counting {1,3}, {1,5}, {2,4}, {2,6}, {3,5}, {4,6}.
Table starts:
  0,
  0, 1,
  0, 2, 0,
  0, 3, 3, 0,
  0, 4, 0, 4, 0,
  0, 5, 0, 0, 5, 0,
  0, 6, 6,12, 6, 6, 0,
  0, 7, 0, 0, 0, 0, 7, 0,
  0, 8, 0,24, 0,24, 0, 8, 0,
  0, 9, 9, 0,18,18, 0, 9, 9, 0
		

Crossrefs

Programs

  • Mathematica
    <
    				

A273096 Number of rotationally inequivalent minimal relations of roots of unity of weight n.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 3, 3, 4, 6, 18, 69
Offset: 0

Views

Author

Keywords

Comments

In this context, a relation of weight n is a multiset of n roots of unity which sum to zero, and it is minimal if no proper nonempty sub-multiset sums to zero. Relations are rotationally equivalent if they are obtained by multiplying each element by a common root of unity.
Mann classified the minimal relations up to weight 7, Conway and Jones up to weight 9, and Poonen and Rubinstein up to weight 12.

Examples

			Writing e(x) = exp(2*Pi*i*x), then e(1/6)+e(1/5)+e(2/5)+e(3/5)+e(4/5)+e(5/6) = 0 and this is the unique (up to rotation) minimal relation of weight 6.
		

Crossrefs

Previous Showing 11-20 of 21 results. Next