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.

Showing 1-4 of 4 results.

A304482 Number A(n,k) of n-element subsets of [k*n] whose elements sum to a multiple of n. Square array A(n,k) with n, k >= 0 read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 3, 2, 1, 0, 1, 4, 6, 8, 0, 0, 1, 5, 12, 30, 18, 1, 0, 1, 6, 20, 76, 126, 52, 0, 0, 1, 7, 30, 155, 460, 603, 152, 1, 0, 1, 8, 42, 276, 1220, 3104, 3084, 492, 0, 0, 1, 9, 56, 448, 2670, 10630, 22404, 16614, 1618, 1, 0, 1, 10, 72, 680, 5138, 28506, 98900, 169152, 91998, 5408, 0, 0
Offset: 0

Views

Author

Marko Riedel, Aug 28 2018

Keywords

Comments

When k=1 the only subset of [n] with n elements is [n] which sums to n(n+1)/2 and hence for n>0 and n even A(n,1) is zero and for n odd A(n,1) is one.

Examples

			Square array A(n,k) begins:
  1, 1,   1,     1,      1,      1,       1,        1, ...
  0, 1,   2,     3,      4,      5,       6,        7, ...
  0, 0,   2,     6,     12,     20,      30,       42, ...
  0, 1,   8,    30,     76,    155,     276,      448, ...
  0, 0,  18,   126,    460,   1220,    2670,     5138, ...
  0, 1,  52,   603,   3104,  10630,   28506,    64932, ...
  0, 0, 152,  3084,  22404,  98900,  324516,   874104, ...
  0, 1, 492, 16614, 169152, 960650, 3854052, 12271518, ...
		

Crossrefs

Main diagonal gives A318477.

Programs

  • Maple
    with(numtheory):
    A:= (n, k)-> `if`(n=0, 1, add(binomial(k*d, d)*(-1)^(n+d)*
                  phi(n/d), d in divisors(n))/n):
    seq(seq(A(n, d-n), n=0..d), d=0..11);
  • Mathematica
    A[n_, k_] : = (-1)^n (1/n) Sum[Binomial[k d, d] (-1)^d EulerPhi[n/d], {d, Divisors[n]}]; A[0, 0] = 1; A[, 0] = 0; A[0, ] = 1;
    Table[A[n-k, k], {n, 0, 11}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Sep 23 2019 *)
  • PARI
    T(n,k)=if(n==0, 1, (-1)^n*sumdiv(n, d, binomial(k*d, d) * (-1)^d * eulerphi(n/d))/n)
    for(n=0, 7, for(k=0, 7, print1(T(n, k), ", ")); print); \\ Andrew Howroyd, Aug 28 2018

Formula

A(n,k) = (-1)^n * (1/n) * Sum_{d|n} C(k*d,d)*(-1)^d*phi(n/d), boundary values A(0,0) = 1, A(n, 0) = 0, A(0, k) = 1.

A169888 Number of n-member subsets of 1..2n whose elements sum to a multiple of n.

Original entry on oeis.org

1, 2, 2, 8, 18, 52, 152, 492, 1618, 5408, 18452, 64132, 225432, 800048, 2865228, 10341208, 37568338, 137270956, 504171584, 1860277044, 6892335668, 25631327688, 95640829924, 357975249028, 1343650267288, 5056424257552, 19073789328752, 72108867620204
Offset: 0

Views

Author

N. J. A. Sloane, Jul 07 2010, based on a letter from Jean-Claude Babois

Keywords

Comments

This is twice A145855 (for n>0), which is the main entry for this problem.

Crossrefs

Programs

  • Maple
    with(combinat): t0:=[]; for n from 1 to 8 do ans:=0; t1:=choose(2*n,n); for i in t1 do s1:=add(i[j],j=1..n); if s1 mod n = 0 then ans:=ans+1; fi; od: t0:=[op(t0),ans]; od:
  • Mathematica
    a[n_] := Sum[(-1)^(n+d)*EulerPhi[n/d]*Binomial[2d, d]/n, {d, Divisors[n]}]; Table[a[n], {n, 1, 26}] (* Jean-François Alcover, Oct 22 2012, after T. D. Noe's program in A145855 *)
  • PARI
    a(n) = if(n==0, 1, sumdiv(n, d, (-1)^(n+d)*eulerphi(n/d)*binomial(2*d, d)/n)); \\ Altug Alkan, Aug 27 2018, after T. D. Noe at A145855

Formula

a(n) = A061865(2n,n). - Alois P. Heinz, Aug 28 2018
a(n) ~ 2^(2*n) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Mar 28 2023

Extensions

a(0)=1 prepended by Alois P. Heinz, Aug 26 2018

A318432 Number of n-element subsets of [4n] whose elements sum to a multiple of n.

Original entry on oeis.org

1, 4, 12, 76, 460, 3104, 22404, 169152, 1315020, 10460416, 84764512, 697212652, 5805722692, 48847196896, 414623627136, 3546272614976, 30532934225100, 264420681260336, 2301782759539392, 20129523771781288, 176765807152990560, 1558058796052048968
Offset: 0

Views

Author

Marko Riedel, Aug 26 2018

Keywords

Crossrefs

Column k=4 of A304482.

Programs

  • Maple
    with(numtheory); a := n -> `if`(n=0, 1, (-1)^n * 1/n * add(binomial(4*d,d)*(-1)^d*phi(n/d), d in divisors(n)));
  • PARI
    a(n) = if (n, (-1)^n * (1/n) * sumdiv(n, d, binomial(4*d,d)*(-1)^d*eulerphi(n/d)), 1); \\ Michel Marcus, Aug 27 2018

Formula

a(n) = (-1)^n * (1/n) * Sum_{d|n} C(4d,d)*(-1)^d*phi(n/d) for n>0, a(0)=1.

A318433 Number of n-element subsets of [5n] whose elements sum to a multiple of n.

Original entry on oeis.org

1, 5, 20, 155, 1220, 10630, 98900, 960650, 9613700, 98462675, 1027222520, 10877596900, 116613287300, 1263159501180, 13803839298920, 152000845788280, 1684888825463940, 18785707522181965, 210536007879090140, 2370423142929112065, 26799168520704093720
Offset: 0

Views

Author

Marko Riedel, Aug 26 2018

Keywords

Crossrefs

Column k=5 of A304482.

Programs

  • Maple
    with(numtheory); a := n -> `if`(n=0, 1, (-1)^n * 1/n * add(binomial(5*d,d)*(-1)^d*phi(n/d), d in divisors(n)));
  • PARI
    a(n) = if (n, (-1)^n * (1/n) * sumdiv(n, d, binomial(5*d,d)*(-1)^d*eulerphi(n/d)), 1); \\ Michel Marcus, Aug 27 2018

Formula

a(n) = (-1)^n * (1/n) * Sum_{d|n} C(5d,d)*(-1)^d*phi(n/d) for n>0, a(0)=1.
Showing 1-4 of 4 results.