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

A079309 a(n) = C(1,1) + C(3,2) + C(5,3) + ... + C(2*n-1,n).

Original entry on oeis.org

1, 4, 14, 49, 175, 637, 2353, 8788, 33098, 125476, 478192, 1830270, 7030570, 27088870, 104647630, 405187825, 1571990935, 6109558585, 23782190485, 92705454895, 361834392115, 1413883873975, 5530599237775, 21654401079325, 84859704298201, 332818970772253
Offset: 1

Views

Author

Miklos Kristof, Feb 10 2003

Keywords

Comments

a(n) is the sum of pyramid weights of all Dyck paths of length 2n (for pyramid weight see Denise and Simion). Equivalently, a(n) is the sum of the total lengths of end branches of an ordered tree, summation being over all ordered trees with n edges. For example, the five ordered trees with 3 edges have total lengths of endbranches 3,2,3,3 and 3. - Emeric Deutsch, May 30 2003
a(n) is the number of Motzkin paths of length 2n with exactly one level segment. (A level segment is a maximal sequence of contiguous flatsteps.) Example: for n=2, the paths counted are FFFF, FFUD, UDFF, UFFD. The formula for a(n) below counts these paths by length of the level segment. - David Callan, Jul 15 2004
The inverse Catalan transform yields A024495, shifted once left. - R. J. Mathar, Jul 07 2009
From Paul Barry, Mar 29 2010: (Start)
Hankel transform is A138341.
The aerated sequence 0, 0, 1, 0, 4, 0, 14, 0, 49, ... has e.g.f. int(cosh(x-t)*Bessel_I(1,2t), t = 0..x). (End)
a(n) is the number of terms of A031443 not exceeding 4^n. - Vladimir Shevelev, Oct 01 2010
Also the number of nonempty subsets of {1..2n} with median n, bisection of A361801. The version containing n is A001700 (bisected). Replacing 2n with 2n+1 and n with n+1 gives A006134. For mean instead of median we have A212352. - Gus Wiseman, Apr 16 2023

Examples

			a(4) = C(1,1) + C(3,2) + C(5,3) + C(7,4) = 1 + 3 + 10 + 35 = 49.
G.f. = x + 4*x^2 + 14*x^3 + 49*x^4 + 175*x^5 + 637*x^6 + 2353*x^7 + ...
From _Gus Wiseman_, Apr 16 2023: (Start)
The a(1) = 1 through a(3) = 14 subsets of {1..2n} with median n:
  {1}  {2}      {3}
       {1,3}    {1,5}
       {1,2,3}  {2,4}
       {1,2,4}  {1,3,4}
                {1,3,5}
                {1,3,6}
                {2,3,4}
                {2,3,5}
                {2,3,6}
                {1,2,4,5}
                {1,2,4,6}
                {1,2,3,4,5}
                {1,2,3,4,6}
                {1,2,3,5,6}
(End)
		

Crossrefs

Equals A024718(n) - 1.
This is the even (or odd) bisection of A361801.
A007318 counts subsets by length, A327481 by mean, A013580 by median.
A359893 and A359901 count partitions by median.

Programs

  • Maple
    a := n -> add(binomial(2*j, j)/2, j=1..n): seq(a(n), n=1..24); # Zerinvary Lajos, Oct 25 2006
    a := n -> add(abs(binomial(-j, -2*j)), j=1..n): seq(a(n), n=1..24); # Zerinvary Lajos, Oct 03 2007
    f:= gfun:-rectoproc({n*a(n) +(-5*n+2)*a(n-1) +2*(2*n-1)*a(n-2)=0,a(1)=1,a(2)=4},a(n),remember):
    map(f, [$1..100]); # Robert Israel, Jun 24 2015
  • Mathematica
    Rest[CoefficientList[Series[(1/Sqrt[1-4*x]-1)/(1-x)/2, {x, 0, 20}], x]] (* Vaclav Kotesovec, Feb 13 2014 *)
    Accumulate[Table[Binomial[2n-1,n],{n,30}]] (* Harvey P. Dale, Jan 06 2021 *)
  • PARI
    {a(n) = sum(k=1, n, binomial(2*k - 1, k))}; /* Michael Somos, Feb 14 2006 */
    
  • PARI
    my(x='x+O('x^40)); Vec((1/sqrt(1-4*x)-1)/(1-x)/2) \\ Altug Alkan, Dec 24 2015

Formula

a(n) = (1/2)*(C(2, 1) + C(4, 2) + C(6, 3) + ... + C(2*n, n)) = A066796(n)/2. - Vladeta Jovovic, Feb 12 2003
G.f.: (1/sqrt(1 - 4*x) - 1)/(1 - x)/2. - Vladeta Jovovic, Feb 12 2003
Given g.f. A(x), then x * A(x - x^2) is g.f. of A024495. - Michael Somos, Feb 14 2006
a(n) = A066796(n)/2. - Zerinvary Lajos, Oct 25 2006
a(n) = Sum_{0 <= i <= j <= n} binomial(i+j, i). - Benoit Cloitre, Nov 25 2006
D-finite with recurrence n*a(n) + (-5*n+2)*a(n-1) + 2*(2*n-1)*a(n-2) = 0. - R. J. Mathar, Nov 30 2012
a(n) ~ 2^(2*n+1) / (3*sqrt(Pi*n)). - Vaclav Kotesovec, Feb 13 2014
a(n) = Sum_{k=0..n-1} A001700(k). - Doug Bell, Jun 23 2015
a(n) = -binomial(2*n+1, n)*hypergeom([1, n+3/2], [n+2], 4) - (i/sqrt(3) + 1)/2. - Peter Luschny, May 18 2018
From Gus Wiseman, Apr 18 2023: (Start)
a(n) = A024718(n) - 1.
a(n) = A231147(2n+1,n).
a(n) = A361801(2n) = A361801(2n+1). (End)
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*binomial(2*n+2-k, n-2*k). - Michael Weselcouch, Jun 17 2025
a(n) = binomial(2*(1+n), n)*hypergeom([1, (1-n)/2, -n/2], [-2*(1+n), 3+n], 4). - Stefano Spezia, Jun 18 2025

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 11 2003

A000980 Number of ways of writing 0 as Sum_{k=-n..n} e(k)*k, where e(k) is 0 or 1.

Original entry on oeis.org

2, 4, 8, 20, 52, 152, 472, 1520, 5044, 17112, 59008, 206260, 729096, 2601640, 9358944, 33904324, 123580884, 452902072, 1667837680, 6168510256, 22903260088, 85338450344, 318995297200, 1195901750512, 4495448217544, 16940411201280, 63983233268592
Offset: 0

Views

Author

Keywords

Comments

The 4-term sequence 2,4,8,20 is the answer to the "Solitaire Army" problem, or checker-jumping puzzle. It is too short to have its own entry. See Conway et a;., Winning Ways, Vol. 2, pp. 715-717. - N. J. A. Sloane, Mar 01 2018
Number of subsets of {-n..n} with sum 0. Also the number of subsets of {0..2n} that are empty or have mean n. For median instead of mean we have twice A024718. - Gus Wiseman, Apr 23 2023

Examples

			From _Gus Wiseman_, Apr 23 2023: (Start)
The a(0) = 2 through a(2) = 8 subsets of {-n..n} with sum 0 are:
  {}   {}        {}
  {0}  {0}       {0}
       {-1,1}    {-1,1}
       {-1,0,1}  {-2,2}
                 {-1,0,1}
                 {-2,0,2}
                 {-2,-1,1,2}
                 {-2,-1,0,1,2}
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 294.
  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see pp. 715-717.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A047653(n) = a(n)/2.
Bisection of A084239. Cf. A063865, A141000.
A007318 counts subsets by length, A327481 by integer mean.
A327475 counts subsets with integer mean, A000975 integer median.

Programs

  • Haskell
    a000980 n = length $ filter ((== 0) . sum) $ subsequences [-n..n]
  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
          `if`(i=0, 1, 2*b(n, i-1)+b(n+i, i-1)+b(abs(n-i), i-1)))
        end:
    a:=n-> 2*b(0, n):
    seq(a(n), n=0..40); # Alois P. Heinz, Mar 10 2014
  • Mathematica
    a[n_] := SeriesCoefficient[ Product[1+x^k, {k, -n, n}], {x, 0, 0}]; a[0] = 2; Table[a[n], {n, 0, 24}](* Jean-François Alcover, Nov 28 2011 *)
    nmax = 26; d = {2}; a1 = {};
    Do[
      i = Ceiling[Length[d]/2];
      AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
      d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n] +
        2 PadLeft[PadRight[d, Length[d] + n], Length[d] + 2 n];
      , {n, nmax}];
    a1 (* Ray Chandler, Mar 15 2014 *)
    Table[Length[Select[Subsets[Range[-n,n]],Total[#]==0&]],{n,0,5}] (* Gus Wiseman, Apr 23 2023 *)
  • PARI
    a(n)=polcoeff(prod(k=-n,n,1+x^k),0)
    

Formula

Constant term of Product_{k=-n..n} (1+x^k).
a(n) = Sum_i A067059(2n+1-i, i) = 2+2*Sum_j A047997(n, j); i.e., sum of alternate antidiagonals of A067059 and two more than twice row sums of A047997. - Henry Bottomley, Aug 11 2002
a(n) = A004171(n) - 2*A181765(n).
Coefficient of x^(n*(n+1)/2) in 2*Product_{k=1..n} (1+x^k)^2. - Sean A. Irvine, Oct 03 2011
From Gus Wiseman, Apr 23 2023: (Start)
a(n) = 2*A047653(n).
a(n) = A070925(2n+1) + 1.
a(n) = 2*A133406(2n+1).
a(n) = 2*(A212352(n) + 1).
a(n) = A222955(2n+1).
a(n) = 2*(A362046(2n) + 1).
(End)

Extensions

More terms from Michael Somos, Jun 10 2000

A047653 Constant term in expansion of (1/2) * Product_{k=-n..n} (1 + x^k).

Original entry on oeis.org

1, 2, 4, 10, 26, 76, 236, 760, 2522, 8556, 29504, 103130, 364548, 1300820, 4679472, 16952162, 61790442, 226451036, 833918840, 3084255128, 11451630044, 42669225172, 159497648600, 597950875256, 2247724108772, 8470205600640, 31991616634296, 121086752349064
Offset: 0

Views

Author

Keywords

Comments

Or, constant term in expansion of Product_{k=1..n} (x^k + 1/x^k)^2. - N. J. A. Sloane, Jul 09 2008
Or, maximal coefficient of the polynomial (1+x)^2 * (1+x^2)^2 *...* (1+x^n)^2.
a(n) = A000302(n) - A181765(n).
From Gus Wiseman, Apr 18 2023: (Start)
Also the number of subsets of {1..2n} that are empty or have mean n. The a(0) = 1 through a(3) = 10 subsets are:
{} {} {} {}
{1} {2} {3}
{1,3} {1,5}
{1,2,3} {2,4}
{1,2,6}
{1,3,5}
{2,3,4}
{1,2,3,6}
{1,2,4,5}
{1,2,3,4,5}
Also the number of subsets of {-n..n} with no 0's but with sum 0. The a(0) = 1 through a(3) = 10 subsets are:
{} {} {} {}
{-1,1} {-1,1} {-1,1}
{-2,2} {-2,2}
{-2,-1,1,2} {-3,3}
{-3,1,2}
{-2,-1,3}
{-2,-1,1,2}
{-3,-1,1,3}
{-3,-2,2,3}
{-3,-2,-1,1,2,3}
(End)

Crossrefs

Cf. A025591.
Cf. A053632; variant: A127728.
For median instead of mean we have A079309(n) + 1.
Odd bisection of A133406.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length, A327481 by mean.

Programs

  • Maple
    f:=n->coeff( expand( mul((x^k+1/x^k)^2,k=1..n) ),x,0);
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
          `if`(i=0, 1, 2*b(n, i-1)+b(n+i, i-1)+b(abs(n-i), i-1)))
        end:
    a:=n-> b(0, n):
    seq(a(n), n=0..40);  # Alois P. Heinz, Mar 10 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[n>i*(i+1)/2, 0, If[i == 0, 1, 2*b[n, i-1]+b[n+i, i-1]+b[Abs[n-i], i-1]]]; a[n_] := b[0, n]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)
    nmax = 26; d = {1}; a1 = {};
    Do[
      i = Ceiling[Length[d]/2];
      AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
      d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n] +
        2 PadLeft[PadRight[d, Length[d] + n], Length[d] + 2 n];
    , {n, nmax}];
    a1 (* Ray Chandler, Mar 15 2014 *)
    Table[Length[Select[Subsets[Range[2n]],Length[#]==0||Mean[#]==n&]],{n,0,6}] (* Gus Wiseman, Apr 18 2023 *)
  • PARI
    a(n)=polcoeff(prod(k=-n,n,1+x^k),0)/2
    
  • PARI
    {a(n)=sum(k=0,n*(n+1)/2,polcoeff(prod(m=1,n,1+x^m+x*O(x^k)),k)^2)} \\ Paul D. Hanna, Nov 30 2010

Formula

Sum of squares of coefficients in Product_{k=1..n} (1+x^k):
a(n) = Sum_{k=0..n(n+1)/2} A053632(n,k)^2. - Paul D. Hanna, Nov 30 2010
a(n) = A000980(n)/2.
a(n) ~ sqrt(3) * 4^n / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Sep 11 2014
From Gus Wiseman, Apr 18 2023 (Start)
a(n) = A133406(2n+1).
a(n) = A212352(n) + 1.
a(n) = A362046(2n) + 1.
(End)

Extensions

More terms from Michael Somos, Jun 10 2000

A361801 Number of nonempty subsets of {1..n} with median n/2.

Original entry on oeis.org

0, 0, 1, 1, 4, 4, 14, 14, 49, 49, 175, 175, 637, 637, 2353, 2353, 8788, 8788, 33098, 33098, 125476, 125476, 478192, 478192, 1830270, 1830270, 7030570, 7030570, 27088870, 27088870, 104647630, 104647630, 405187825, 405187825, 1571990935, 1571990935
Offset: 0

Views

Author

Gus Wiseman, Apr 07 2023

Keywords

Comments

The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).

Examples

			The subset {1,2,3,5} of {1..5} has median 5/2, so is counted under a(5).
The subset {2,3,5} of {1..6} has median 6/2, so is counted under a(6).
The a(0) = 0 through a(7) = 14 subsets:
  .  .  {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
                    {1,3}    {2,3}      {1,5}        {2,5}
                    {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                    {1,2,4}  {1,2,3,5}  {1,3,4}      {1,2,5,6}
                                        {1,3,5}      {1,2,5,7}
                                        {1,3,6}      {1,3,4,5}
                                        {2,3,4}      {1,3,4,6}
                                        {2,3,5}      {1,3,4,7}
                                        {2,3,6}      {2,3,4,5}
                                        {1,2,4,5}    {2,3,4,6}
                                        {1,2,4,6}    {2,3,4,7}
                                        {1,2,3,4,5}  {1,2,3,4,5,6}
                                        {1,2,3,4,6}  {1,2,3,4,5,7}
                                        {1,2,3,5,6}  {1,2,3,4,6,7}
		

Crossrefs

A bisection is A079309.
The case with n's has bisection A057552.
The case without n's is A100066, bisection A006134.
A central diagonal of A231147.
A version for partitions is A361849.
For mean instead of median we have A362046.
A000975 counts subsets with integer median, for mean A327475.
A007318 counts subsets by length.
A013580 appears to count subsets by median, by mean A327481.
A360005(n)/2 represents the median statistic for partitions.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Median[#]==n/2&]],{n,0,10}]

Formula

a(n) = A079309(floor(n/2)). - Alois P. Heinz, Apr 11 2023

A070925 Number of subsets of A = {1,2,...,n} that have the same center of gravity as A, i.e., (n+1)/2.

Original entry on oeis.org

1, 1, 3, 3, 7, 7, 19, 17, 51, 47, 151, 137, 471, 427, 1519, 1391, 5043, 4651, 17111, 15883, 59007, 55123, 206259, 193723, 729095, 688007, 2601639, 2465133, 9358943, 8899699, 33904323, 32342235, 123580883, 118215779, 452902071, 434314137, 1667837679, 1602935103
Offset: 1

Views

Author

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

Keywords

Comments

From Gus Wiseman, Apr 15 2023: (Start)
Also the number of nonempty subsets of {0..n} with mean n/2. The a(0) = 1 through a(5) = 7 subsets are:
{0} {0,1} {1} {0,3} {2} {0,5}
{0,2} {1,2} {0,4} {1,4}
{0,1,2} {0,1,2,3} {1,3} {2,3}
{0,2,4} {0,1,4,5}
{1,2,3} {0,2,3,5}
{0,1,3,4} {1,2,3,4}
{0,1,2,3,4} {0,1,2,3,4,5}
(End)

Examples

			Of the 32 (2^5) sets which can be constructed from the set A = {1,2,3,4,5} only the sets {3}, {2, 3, 4}, {2, 4}, {1, 2, 4, 5}, {1, 2, 3, 4, 5}, {1, 3, 5}, {1, 5} give an average of 3.
		

Crossrefs

The odd bisection is A000980(n) - 1 = 2*A047653(n) - 1.
For median instead of mean we have A100066, bisection A006134.
Including the empty set gives A222955.
The one-based version is A362046, even bisection A047653(n) - 1.
A007318 counts subsets by length.
A067538 counts partitions with integer mean, strict A102627.
A231147 counts subsets by median.
A327481 counts subsets by integer mean.

Programs

  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; f[n_] := Block[{s = Subsets[n], c = 0, k = 2}, While[k < 2^n + 1, If[ (Plus @@ s[[k]]) / Length[s[[k]]] == (n + 1)/2, c++ ]; k++ ]; c]; Table[ f[n], {n, 1, 20}]
    (* second program *)
    Table[Length[Select[Subsets[Range[0,n]],Mean[#]==n/2&]],{n,0,10}] (* Gus Wiseman, Apr 15 2023 *)

Formula

From Gus Wiseman, Apr 18 2023: (Start)
a(2n+1) = A000980(n) - 1.
a(n) = A222955(n) - 1.
a(n) = 2*A362046(n) + 1.
(End)

Extensions

Edited by Robert G. Wilson v and John W. Layman, May 25 2002
a(34)-a(38) from Fausto A. C. Cariboni, Oct 08 2020

A133406 Half the number of ways of placing up to n pawns on a length n chessboard row so that the row balances at its middle.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 10, 9, 26, 24, 76, 69, 236, 214, 760, 696, 2522, 2326, 8556, 7942, 29504, 27562, 103130, 96862, 364548, 344004, 1300820, 1232567, 4679472, 4449850, 16952162, 16171118, 61790442, 59107890, 226451036, 217157069, 833918840
Offset: 1

Views

Author

R. H. Hardin, Nov 24 2007

Keywords

Comments

Odd-indexed terms are A047653.
Also the number of subsets of {1..n-1} that are empty or have mean (n-1)/2. - Gus Wiseman, Apr 23 2023

Examples

			From _Gus Wiseman_, Apr 23 2023: (Start)
The a(1) = 1 through a(8) = 9 subsets:
  {}  {}  {}   {}     {}       {}         {}           {}
          {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
                      {1,3}    {2,3}      {1,5}        {2,5}
                      {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                                          {1,2,6}      {1,2,4,7}
                                          {1,3,5}      {1,2,5,6}
                                          {2,3,4}      {1,3,4,6}
                                          {1,2,3,6}    {2,3,4,5}
                                          {1,2,4,5}    {1,2,3,4,5,6}
                                          {1,2,3,4,5}
(End)
		

Crossrefs

For median instead of mean we have A361801 + 1, the doubling of A024718.
Not counting the empty set gives A362046 (shifted left).
A007318 counts subsets by length, A327481 by integer mean.
A047653 counts subsets of {1..2n} with mean n, nonempty A212352.
A070925 counts subsets of {1..2n-1} with mean n, nonempty A000980.
A327475 counts subsets with integer mean, nonempty A051293.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Length[#]==0||Mean[#]==n/2&]],{n,0,10}] (* Gus Wiseman, Apr 23 2023 *)
  • PARI
    a(n) = {polcoef(prod(k=1, n, 1 + 'x^(2*k-n-1)), 0)/2} \\ Andrew Howroyd, Jan 07 2023

Formula

From Gus Wiseman, Apr 23 2023: (Start)
a(2n+1) = A000980(n)/2 = A047653(n).
a(n) = A362046(n-1) + 1.
(End)

A212352 Row sums of A047997.

Original entry on oeis.org

0, 1, 3, 9, 25, 75, 235, 759, 2521, 8555, 29503, 103129, 364547, 1300819, 4679471, 16952161, 61790441, 226451035, 833918839, 3084255127, 11451630043, 42669225171, 159497648599, 597950875255, 2247724108771, 8470205600639
Offset: 0

Views

Author

N. J. A. Sloane, May 16 2012

Keywords

Comments

Also the number of nonempty subsets of {1..2n} with mean n, even bisection of A362046. - Gus Wiseman, Apr 15 2023

Examples

			From _Gus Wiseman_, Apr 15 2023: (Start)
The a(1) = 1 through a(3) = 9 subsets:
  {1}  {2}      {3}
       {1,3}    {1,5}
       {1,2,3}  {2,4}
                {1,2,6}
                {1,3,5}
                {2,3,4}
                {1,2,3,6}
                {1,2,4,5}
                {1,2,3,4,5}
(End)
		

Crossrefs

Equals A047653(n) - 1.
Row sums of A047997.
For median instead of mean we have A079309, bisection of A361801.
Even bisection of A362046, zero-based version A070925.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length.
A327475 counts subsets with integer mean.
A327481 counts subsets by mean.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[2n]],Mean[#]==n&]],{n,0,6}] (* Gus Wiseman, Apr 15 2023 *)

Formula

From Gus Wiseman, Apr 15 2023: (Start)
a(n) = A000980(n)/2 - 1.
a(n) = A047653(n) - 1.
a(n) = A133406(2n+1) - 1.
a(n) = A362046(2n).
(End)

A047997 Triangle of numbers a(n,k) = number of balance positions when k equal weights are placed at a k-subset of the points {-n, -(n-1), ..., n-1, n} on a centrally pivoted rod.

Original entry on oeis.org

1, 1, 2, 1, 3, 5, 1, 4, 8, 12, 1, 5, 13, 24, 32, 1, 6, 18, 43, 73, 94, 1, 7, 25, 69, 141, 227, 289, 1, 8, 32, 104, 252, 480, 734, 910, 1, 9, 41, 150, 414, 920, 1656, 2430, 2934, 1, 10, 50, 207, 649, 1636, 3370, 5744, 8150, 9686, 1, 11, 61, 277, 967
Offset: 1

Views

Author

Keywords

Comments

Also the number of k-subsets of {1..2n-1} with mean n. - Gus Wiseman, Apr 16 2023

Examples

			From _Gus Wiseman_, Apr 18 2023: (Start)
Triangle begins:
    1
    1    2
    1    3    5
    1    4    8   12
    1    5   13   24   32
    1    6   18   43   73   94
    1    7   25   69  141  227  289
    1    8   32  104  252  480  734  910
    1    9   41  150  414  920 1656 2430 2934
Row n = 4 counts the following balanced subsets:
  {0}  {-1,1}  {-1,0,1}   {-3,0,1,2}
       {-2,2}  {-2,0,2}   {-4,0,1,3}
       {-3,3}  {-3,0,3}   {-2,-1,0,3}
       {-4,4}  {-3,1,2}   {-2,-1,1,2}
               {-4,0,4}   {-3,-1,0,4}
               {-4,1,3}   {-3,-1,1,3}
               {-2,-1,3}  {-3,-2,1,4}
               {-3,-1,4}  {-3,-2,2,3}
                          {-4,-1,1,4}
                          {-4,-1,2,3}
                          {-4,-2,2,4}
                          {-4,-3,3,4}
(End)
		

Crossrefs

Last column is a(n,n) = A002838(n).
Row sums are A212352(n) = A047653(n)-1 = A000980(n)/2-1.
A007318 counts subsets by length, A327481 by mean, A013580 by median.
A327475 counts subsets with integer mean.

Programs

  • Mathematica
    a[n_, k_] := Length[ IntegerPartitions[ n*(2k - n + 1)/2, n, Range[2k - n + 1]]]; Flatten[ Table[ a[n, k], {k, 1, 11}, {n, 1, k}]] (* Jean-François Alcover, Jan 02 2012 *)
    Table[Length[Select[Subsets[Range[-n,n]],Length[#]==k&&Total[#]==0&]],{n,8},{k,n}] (* Gus Wiseman, Apr 16 2023 *)

Formula

Equivalent to number of partitions of n(2k-n+1)/2 into up to n parts each no more than 2k-n+1 so a(n, k)=A067059(n, n(2k-n+1)/2); row sums are A047653(n)-1 = A212352(n). - Henry Bottomley, Aug 11 2001

A361802 Irregular triangle read by rows where T(n,k) is the number of k-subsets of {-n+1,...,n} with sum 0, for k = 1,...,2n-1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 3, 6, 7, 5, 2, 1, 1, 4, 10, 16, 18, 14, 8, 3, 1, 1, 5, 15, 31, 46, 51, 43, 27, 12, 3, 1, 1, 6, 21, 53, 98, 139, 155, 134, 88, 43, 16, 4, 1, 1, 7, 28, 83, 184, 319, 441, 486, 424, 293, 161, 68, 21, 4, 1
Offset: 1

Views

Author

Gus Wiseman, Apr 10 2023

Keywords

Comments

Also the number of k-subsets of {1,...,2n} with mean n.

Examples

			Triangle begins:
   1
   1   1   1
   1   2   3   2   1
   1   3   6   7   5   2   1
   1   4  10  16  18  14   8   3   1
   1   5  15  31  46  51  43  27  12   3   1
   1   6  21  53  98 139 155 134  88  43  16   4   1
   1   7  28  83 184 319 441 486 424 293 161  68  21   4   1
Row n = 3 counts the following subsets:
  {0}  {-1,1}  {-1,0,1}   {-2,-1,0,3}  {-2,-1,0,1,2}
       {-2,2}  {-2,0,2}   {-2,-1,1,2}
               {-2,-1,3}
		

Crossrefs

Row lengths are A005408.
Row sums are A212352.
A007318 counts subsets by length.
A067538 counts partitions with integer mean.
A231147 counts subsets by median.
A327475 counts subsets with integer mean, median A000975.
A327481 counts subsets by mean.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[-n+1,n],{k}],Total[#]==0&]],{n,6},{k,2n-1}]
Showing 1-9 of 9 results.