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-8 of 8 results.

A318557 Number A(n,k) of n-member subsets of [k*n] whose elements sum to a multiple of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 5, 10, 1, 0, 1, 1, 6, 30, 38, 1, 0, 1, 1, 9, 55, 165, 126, 1, 0, 1, 1, 10, 91, 460, 1001, 452, 1, 0, 1, 1, 13, 138, 969, 3876, 6198, 1716, 1, 0, 1, 1, 14, 190, 1782, 10630, 33594, 38760, 6470, 1, 0, 1, 1, 17, 253, 2925, 23751, 118755, 296010, 245157, 24310, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 28 2018

Keywords

Comments

The sequence of row n satisfies a linear recurrence with constant coefficients of order A018804(n) for n>0.

Examples

			A(3,2) = 10: {1,2,3}, {1,2,5}, {1,3,4}, {1,3,6}, {1,4,5}, {1,5,6}, {2,3,5}, {2,4,6}, {3,4,5}, {3,5,6}.
A(2,3) = 5: {1,2}, {1,5}, {2,4}, {3,6}, {4,5}.
Square array A(n,k) begins:
  1, 1,    1,     1,      1,       1,       1,        1, ...
  0, 1,    1,     1,      1,       1,       1,        1, ...
  0, 1,    2,     5,      6,       9,      10,       13, ...
  0, 1,   10,    30,     55,      91,     138,      190, ...
  0, 1,   38,   165,    460,     969,    1782,     2925, ...
  0, 1,  126,  1001,   3876,   10630,   23751,    46376, ...
  0, 1,  452,  6198,  33594,  118755,  324516,   749398, ...
  0, 1, 1716, 38760, 296010, 1344904, 4496388, 12271518, ...
		

Crossrefs

Main diagonal gives A318477.

Programs

  • Mathematica
    nmax = 11; (* Program not suitable to compute a large number of terms. *)
    A[n_, k_] := A[n, k] = Count[Subsets[Range[k n], {n}], s_ /; Divisible[Total[s], k]]; A[0, _] = 1;
    Table[A[n - k, k], {n, 0, nmax}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Oct 04 2019 *)

A309148 A(n,k) is (1/k) times the number of n-member subsets of [k*n] whose elements sum to a multiple of n; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 4, 0, 1, 3, 10, 9, 1, 1, 4, 19, 42, 26, 0, 1, 5, 31, 115, 201, 76, 1, 1, 6, 46, 244, 776, 1028, 246, 0, 1, 7, 64, 445, 2126, 5601, 5538, 809, 1, 1, 8, 85, 734, 4751, 19780, 42288, 30666, 2704, 0, 1, 9, 109, 1127, 9276, 54086, 192130, 328755, 173593, 9226, 1
Offset: 1

Views

Author

Alois P. Heinz, Jul 14 2019

Keywords

Comments

For k > 1 also (1/(k-1)) times the number of n-member subsets of [k*n-1] whose elements sum to a multiple of n.
The sequence of row n satisfies a linear recurrence with constant coefficients of order n.

Examples

			Square array A(n,k) begins:
  1,   1,    1,     1,      1,      1,       1, ...
  0,   1,    2,     3,      4,      5,       6, ...
  1,   4,   10,    19,     31,     46,      64, ...
  0,   9,   42,   115,    244,    445,     734, ...
  1,  26,  201,   776,   2126,   4751,    9276, ...
  0,  76, 1028,  5601,  19780,  54086,  124872, ...
  1, 246, 5538, 42288, 192130, 642342, 1753074, ...
		

Crossrefs

Rows n=1-3 give: A000012, A001477(k-1), A005448.
Main diagonal gives A308667.

Programs

  • Maple
    with(numtheory):
    A:= (n, k)-> add(binomial(k*d, d)*(-1)^(n+d)*
                 phi(n/d), d in divisors(n))/(n*k):
    seq(seq(A(n, 1+d-n), n=1..d), d=1..12);
  • Mathematica
    A[n_, k_] := 1/(n k) Sum[Binomial[k d, d] (-1)^(n+d) EulerPhi[n/d], {d, Divisors[n]}];
    Table[A[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 04 2019 *)

Formula

A(n,k) = 1/(n*k) * Sum_{d|n} binomial(k*d,d)*(-1)^(n+d)*phi(n/d).
A(n,k) = (1/k) * A304482(n,k).

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

A318431 Number of n-element subsets of [3n] whose elements sum to a multiple of n.

Original entry on oeis.org

1, 3, 6, 30, 126, 603, 3084, 16614, 91998, 520779, 3004206, 17594250, 104308092, 624801960, 3775722348, 22991162130, 140928103134, 868886416869, 5384796884934, 33525472069566, 209592226792326, 1315211209647435, 8281053081282900, 52301607644921262
Offset: 0

Views

Author

Marko Riedel, Aug 26 2018

Keywords

Crossrefs

Column k=3 of A304482.

Programs

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

Formula

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

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.

A318477 Number of n-member subsets of [n^2] whose elements sum to a multiple of n.

Original entry on oeis.org

1, 1, 2, 30, 460, 10630, 324516, 12271518, 553275192, 28987537806, 1731030733840, 116068178638786, 8634941165110140, 705873715441872276, 62895036883536770108, 6067037854078500844740, 629921975126483973659888, 70043473196734767582082246
Offset: 0

Views

Author

Alois P. Heinz, Aug 26 2018

Keywords

Examples

			a(0) = 1: {}.
a(1) = 1: {1}.
a(2) = 2: {1,3}, {2,4}.
a(3) = 30: {1,2,3}, {1,2,6}, {1,2,9}, {1,3,5}, {1,3,8}, {1,4,7}, {1,5,6}, {1,5,9}, {1,6,8}, {1,8,9}, {2,3,4}, {2,3,7}, {2,4,6}, {2,4,9}, {2,5,8}, {2,6,7}, {2,7,9}, {3,4,5}, {3,4,8}, {3,5,7}, {3,6,9}, {3,7,8}, {4,5,6}, {4,5,9}, {4,6,8}, {4,8,9}, {5,6,7}, {5,7,9}, {6,7,8}, {7,8,9}.
		

Crossrefs

Main diagonal of A304482 and of A318557.

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; `if`(n=0, 1, add(phi(n/d)*
          (-1)^(n+d)*binomial(n*d, d), d=divisors(n))/n)
        end:
    seq(a(n), n=0..20);
  • Mathematica
    a[n_] := (-1)^n Sum[(-1)^d Binomial[d n, d] EulerPhi[n/d], {d, Divisors[n]} ]/n; a[0] = 1;
    a /@ Range[0, 20] (* Jean-François Alcover, Sep 23 2019 *)

Formula

a(n) = n * A308667(n) for n >= 1.
a(n) ~ exp(n - 1/2) * n^(n - 3/2) / sqrt(2*Pi). - Vaclav Kotesovec, Mar 28 2023

A308667 (1/n) times the number of n-member subsets of [n^2] whose elements sum to a multiple of n.

Original entry on oeis.org

1, 1, 10, 115, 2126, 54086, 1753074, 69159399, 3220837534, 173103073384, 10551652603526, 719578430425845, 54297978110913252, 4492502634538340722, 404469190271900056316, 39370123445405248353743, 4120204305690280446004838, 461365717080848755611811094
Offset: 1

Views

Author

Alois P. Heinz, Jul 14 2019

Keywords

Crossrefs

Main diagonal of A309148.

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; add(phi(n/d)*
          (-1)^(n+d)*binomial(n*d, d), d=divisors(n))/n^2
        end:
    seq(a(n), n=1..20);
  • Mathematica
    a[n_] := a[n] = Sum[EulerPhi[n/d]*
         (-1)^(n + d)*Binomial[n*d, d], {d, Divisors[n]}]/n^2;
    Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Mar 24 2022, after Alois P. Heinz *)

Formula

a(n) = A309148(n,n).
a(n) = (1/n) * A318477(n).
a(p) == 1 (mod p^3) for all primes p >= 5 (apply Meštrović, Remark 17, p. 12). - Peter Bala, Mar 28 2023
a(n) ~ exp(n - 1/2) * n^(n - 5/2) / sqrt(2*Pi). - Vaclav Kotesovec, Mar 28 2023
Showing 1-8 of 8 results.