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-10 of 20 results. Next

A119358 Number of n-element subsets of [2n] having an even sum.

Original entry on oeis.org

1, 1, 2, 10, 38, 126, 452, 1716, 6470, 24310, 92252, 352716, 1352540, 5200300, 20056584, 77558760, 300546630, 1166803110, 4537543340, 17672631900, 68923356788, 269128937220, 1052049129144, 4116715363800, 16123803193628, 63205303218876, 247959261273752
Offset: 0

Views

Author

Paul Barry, May 16 2006

Keywords

Comments

Old name was: Central coefficients of number triangle A119326.

Examples

			a(3) = 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}. - _Alois P. Heinz_, Feb 04 2017
		

Crossrefs

Column k=2 of A318557.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, 1+n*(n-1)/2,
         ((4*n-10)*(5*n^2-10*n+4)*(a(n-1)+4*(n-2)*a(n-3)
          /(n-1))/(5*n^2-20*n+19)-4*(n-1)*a(n-2))/n)
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Aug 26 2018
  • Mathematica
    Table[HypergeometricPFQ[{1/2 - n/2, 1/2 - n/2, -n/2, -n/2}, {1/2, 1/2, 1}, 1], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 04 2016 *)

Formula

G.f.: (1/sqrt(1-4x)+1/sqrt(1+4x^2))/2.
a(n) = Sum_{k=0..floor(n/2)} C(n,2k)^2.
a(n) = C(2n,n)/2+sin(Pi*(n+1)/2)*C(n,n/2)/2.
a(n) = A119326(2n,n).
a(n) = A071688(n) + A119359(n) for n>=1.
D-finite with recurrence n*(n-1)*(10*n-29)*a(n) +2*(n-1)*(5*n^2-74*n+164)*a(n-1) +4*(-40*n^3+310*n^2 -744*n+559)*a(n-2) +8*(n-2)*(5*n^2-74*n+164)*a(n-3) -16*(25*n-42)*(n-3)*(2*n-7)*a(n-4)=0. - R. J. Mathar, Nov 05 2012
a(n) = hypergeom([(1-n)/2, (1-n)/2, -n/2, -n/2], [1/2, 1/2, 1], 1). - Vladimir Reshetnikov, Oct 04 2016
a(n) = A282011(2n,n). - Alois P. Heinz, Feb 04 2017

Extensions

New name from Alois P. Heinz, Feb 04 2017

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.

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

A318591 Number of n-member subsets of [3*n] whose elements sum to a multiple of three.

Original entry on oeis.org

1, 1, 5, 30, 165, 1001, 6198, 38760, 245157, 1562331, 10015005, 64512240, 417226230, 2707475148, 17620076360, 114955810530, 751616304549, 4923689695575, 32308782871911, 212327989773900, 1397281501935165, 9206478467531865, 60727722660586800, 400978991944396320
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2018

Keywords

Examples

			a(2) = 5: {1,2}, {1,5}, {2,4}, {3,6}, {4,5}.
		

Crossrefs

Column k=3 of A318557.

A318592 Number of n-member subsets of [4*n] whose elements sum to a multiple of four.

Original entry on oeis.org

1, 1, 6, 55, 460, 3876, 33594, 296010, 2630044, 23535820, 211911256, 1917334783, 17417167156, 158753389900, 1451182694940, 13298522298180, 122131736900380, 1123787895356412, 10358022417860040, 95615237915961100, 883829035764950960, 8179808679272664720
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2018

Keywords

Examples

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

Crossrefs

Column k=4 of A318557.

A318593 Number of n-member subsets of [5*n] whose elements sum to a multiple of five.

Original entry on oeis.org

1, 1, 9, 91, 969, 10630, 118755, 1344904, 15380937, 177232627, 2054455670, 23930713170, 279871768995, 3284214703056, 38650751381832, 456002537343580, 5391644226101705, 63871405575418665, 757929628541719755, 9007607943130625829, 107196674080761940470
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2018

Keywords

Examples

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

Crossrefs

Column k=5 of A318557.

Programs

  • Maple
    b:= proc(n, s, m, t) option remember; `if`(n=0, `if`(s=0 and t=0, 1, 0),
          b(n-1, s, m, t)+`if`(t=0, 0, b(n-1, irem(s+n, m), m, t-1)))
        end:
    a:= n-> b(5*n, 0, 5, n):
    seq(a(n), n=0..27);

Formula

a(n) = floor(A163456(n)) + [n mod 5 = 0]*A163455(n/5), with A163456(n) = binomial(5*n,n)/5 and A163455(n) = binomial(5*n-1,n) where [] is an Iverson bracket. - Georg Fischer, Mar 23 2019

A318594 Number of n-member subsets of [6*n] whose elements sum to a multiple of six.

Original entry on oeis.org

1, 1, 10, 138, 1782, 23751, 324516, 4496388, 62893270, 886322982, 12565647510, 179013799328, 2560547711772, 36749279048405, 528955735258632, 7632612327457638, 110375347460981718, 1599199100396803290, 23209746715943492412, 337362380452228509840
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2018

Keywords

Examples

			a(2) = 10: {1,5}, {1,11}, {2,4}, {2,10}, {3,9}, {4,8}, {5,7}, {6,12}, {7,11}, {8,10}.
		

Crossrefs

Column k=6 of A318557.

A318595 Number of n-member subsets of [7*n] whose elements sum to a multiple of seven.

Original entry on oeis.org

1, 1, 13, 190, 2925, 46376, 749398, 12271518, 202927725, 3381098545, 56672074888, 954526728530, 16141841823510, 273897571557780, 4660989191504198, 79515468511191440, 1359472297966470765, 23287391568864135063, 399584727647019644125, 6866816177157320098000
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2018

Keywords

Examples

			a(2) = 13: {1,6}, {1,13}, {2,5}, {2,12}, {3,4}, {3,11}, {4,10}, {5,9}, {6,8}, {7,14}, {8,13}, {9,12}, {10,11}.
		

Crossrefs

Column k=7 of A318557.

A318596 Number of n-member subsets of [8*n] whose elements sum to a multiple of eight.

Original entry on oeis.org

1, 1, 14, 253, 4508, 82251, 1533686, 28989675, 553275192, 10639125640, 205811431514, 4000751045226, 78083583349868, 1529143625215220, 30032524962905850, 591315394579074378, 11667877650711051896, 230672804560960311000, 4568131162533134953328
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2018

Keywords

Examples

			a(2) = 14: {1,7}, {1,15}, {2,6}, {2,14}, {3,5}, {3,13}, {4,12}, {5,11}, {6,10}, {7,9}, {8,16}, {9,15}, {10,14}, {11,13}.
		

Crossrefs

Column k=8 of A318557.
Showing 1-10 of 20 results. Next