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-3 of 3 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 *)

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.

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