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.

Previous Showing 11-20 of 34 results. Next

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

A362046 Number of nonempty subsets of {1..n} with mean n/2.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 9, 8, 25, 23, 75, 68, 235, 213, 759, 695, 2521, 2325, 8555, 7941, 29503, 27561, 103129, 96861, 364547, 344003, 1300819, 1232566, 4679471, 4449849, 16952161, 16171117, 61790441, 59107889, 226451035, 217157068, 833918839, 801467551, 3084255127
Offset: 0

Views

Author

Gus Wiseman, Apr 12 2023

Keywords

Examples

			The a(2) = 1 through a(7) = 8 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}
		

Crossrefs

Using range 0..n gives A070925.
Including the empty set gives A133406.
Even bisection is A212352.
For median instead of mean we have A361801, the doubling of A079309.
A version for partitions is A361853, for median A361849.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length.
A067538 counts partitions with integer mean, strict A102627.
A231147 appears to count subsets by median, full-steps A013580.
A327475 counts subsets with integer mean, A000975 integer median.
A327481 counts subsets by integer mean.

Programs

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

Formula

a(n) = (A070925(n) - 1)/2.
a(n) = A133406(n) - 1.
a(2n) = A212352(n) = A000980(n)/2 - 1.

A361654 Triangle read by rows where T(n,k) is the number of nonempty subsets of {1,...,2n-1} with median n and minimum k.

Original entry on oeis.org

1, 2, 1, 5, 3, 1, 15, 9, 4, 1, 50, 29, 14, 5, 1, 176, 99, 49, 20, 6, 1, 638, 351, 175, 76, 27, 7, 1, 2354, 1275, 637, 286, 111, 35, 8, 1, 8789, 4707, 2353, 1078, 441, 155, 44, 9, 1, 33099, 17577, 8788, 4081, 1728, 650, 209, 54, 10, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 23 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

			Triangle begins:
     1
     2     1
     5     3     1
    15     9     4     1
    50    29    14     5     1
   176    99    49    20     6     1
   638   351   175    76    27     7     1
  2354  1275   637   286   111    35     8     1
  8789  4707  2353  1078   441   155    44     9     1
Row n = 4 counts the following subsets:
  {1,7}            {2,6}        {3,5}    {4}
  {1,4,5}          {2,4,5}      {3,4,5}
  {1,4,6}          {2,4,6}      {3,4,6}
  {1,4,7}          {2,4,7}      {3,4,7}
  {1,2,6,7}        {2,3,5,6}
  {1,3,5,6}        {2,3,5,7}
  {1,3,5,7}        {2,3,4,5,6}
  {1,2,4,5,6}      {2,3,4,5,7}
  {1,2,4,5,7}      {2,3,4,6,7}
  {1,2,4,6,7}
  {1,3,4,5,6}
  {1,3,4,5,7}
  {1,3,4,6,7}
  {1,2,3,5,6,7}
  {1,2,3,4,5,6,7}
		

Crossrefs

Row sums appear to be A006134.
Column k = 1 appears to be A024718.
Column k = 2 appears to be A006134.
Column k = 3 appears to be A079309.
A000975 counts subsets with integer median, mean A327475.
A007318 counts subsets by length.
A231147 counts subsets by median, full steps A013580, by mean A327481.
A359893 and A359901 count partitions by median.
A360005(n)/2 gives the median statistic.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[2n-1]],Min@@#==k&&Median[#]==n&]],{n,6},{k,n}]
  • PARI
    T(n,k) = sum(j=0, n-k, binomial(2*j+k-2, j)) \\ Andrew Howroyd, Apr 09 2023

Formula

T(n,k) = 1 + Sum_{j=1..n-k} binomial(2*j+k-2, j). - Andrew Howroyd, Apr 09 2023

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)

A176332 Row sums of triangle A176331.

Original entry on oeis.org

1, 2, 5, 16, 56, 202, 741, 2752, 10318, 38972, 148070, 565280, 2166646, 8332378, 32136205, 124249856, 481433286, 1868972828, 7267804550, 28304698336, 110383060776, 431000853028, 1684754608210, 6592277745536, 25818887839956
Offset: 0

Views

Author

Paul Barry, Apr 15 2010

Keywords

Comments

Hankel transform is A176333.
Let A(n) denote the n X n array such that the i-th row of this array is the sequence obtained by applying the partial sum operator i-1 times to the tuple ((sqrt(-1))^m, 1 <= m <= n). Then the negative of the real part of the (n, n)-entry of A(n) equals a(n-2) for all n > 2. - John M. Campbell, Jan 20 2019

Crossrefs

Programs

  • GAP
    List([0..30], n -> Sum([0..n], k -> Sum([0..n], j -> (-1)^(n-j)* Binomial(j, n-k)*Binomial(j, k) ))) # G. C. Greubel, Feb 22 2019
  • Magma
    [(&+[ (&+[(-1)^(n-j)*Binomial(j,n-k)*Binomial(j,k): j in [0..n]]): k in [0..n]]): n in [0..30]]; // G. C. Greubel, Feb 21 2019
    
  • Maple
    a:=n->add(add(binomial(j,n-k)*binomial(j,k)*(-1)^(n-j),j=0..n),k=0..n): seq(a(n),n=0..30); # Muniru A Asiru, Jan 23 2019
  • Mathematica
    f[n_]:= (-1)^n*Sum[Binomial[n+k, k] Cos[Pi(n+k)/2], {k, 0, n}]; Array[f, 24, 0] (* Robert G. Wilson v, Apr 02 2012 *)
  • PARI
    {a(n) = sum(k=0,n, sum(j=0,n, (-1)^(n-j)*binomial(j,n-k)* binomial(j,k))) };vector(30, n, n--; a(n)) \\ G. C. Greubel, Feb 21 2019
    
  • PARI
    a(n) = {my(v = vector(n, k, I^k)); for (k=1, n-1, v = vector(n, i, sum(j=1, i, v[j]));); -real(v[n]);} \\ Michel Marcus, Feb 25 2019
    
  • PARI
    a(n) = sum(k=0, n\2, (-1)^k*binomial(2*n-2*k, n)); \\ Seiichi Manyama, Jan 29 2023
    
  • PARI
    my(N=30, x='x+O('x^N)); Vec(1/(sqrt(1-4*x)*(1+x^2*(2/(1+sqrt(1-4*x)))^2))) \\ Seiichi Manyama, Jan 29 2023
    
  • Sage
    [sum(sum((-1)^(n-j)*binomial(j,n-k)*binomial(j,k) for j in (0..n)) for k in (0..n)) for n in (0..30)] # G. C. Greubel, Feb 21 2019
    

Formula

a(n) = Sum_{k=0..n} Sum_{j=0..n} binomial(j,n-k)*binomial(j,k)*(-1)^(n-j).
Logarithm g.f.: arctan(x*C(x)) = Sum_{n>=1} a(n)/n*x^n, where C(x) = (1-sqrt(1-4*x))/(2*x) (A000108). - Vladimir Kruchinin, Aug 10 2010
Conjecture: 6*n*a(n) + 2*(-17*n+10)*a(n-1) + (47*n-60)*a(n-2) + 10*(-3*n+5)*a(n-3) + 4*(2*n-5)*a(n-4) = 0. - R. J. Mathar, Nov 24 2012
Recurrence: 2*n*(5*n-8)*a(n) = 2*(25*n^2 - 50*n + 18)*a(n-1) - (45*n^2 - 92*n + 36)*a(n-2) + 2*(2*n-3)*(5*n-3)*a(n-3). - Vaclav Kotesovec, Feb 12 2014
a(n) ~ 4^(n+1) / (5*sqrt(Pi*n)). - Vaclav Kotesovec, Feb 12 2014
From Seiichi Manyama, Jan 29 2023: (Start)
a(n) = Sum_{k=0..floor(n/2)} (-1)^k * binomial(2*n-2*k,n).
G.f.: 1 / ( sqrt(1-4*x) * (1 + x^2 * c(x)^2) ), where c(x) is the g.f. of A000108. (End)
a(n) = [x^n] 1/((1+x^2) * (1-x)^(n+1)). - Seiichi Manyama, Apr 08 2024

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

A096465 Triangle (read by rows) formed by setting all entries in the first column and in the main diagonal ((i,i) entries) to 1 and the rest of the entries by the recursion T(n, k) = T(n-1, k) + T(n, k-1).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 4, 1, 1, 4, 8, 9, 1, 1, 5, 13, 22, 23, 1, 1, 6, 19, 41, 64, 65, 1, 1, 7, 26, 67, 131, 196, 197, 1, 1, 8, 34, 101, 232, 428, 625, 626, 1, 1, 9, 43, 144, 376, 804, 1429, 2055, 2056, 1, 1, 10, 53, 197, 573, 1377, 2806, 4861, 6917, 6918, 1, 1, 11, 64, 261, 834, 2211, 5017, 9878, 16795, 23713, 23714, 1
Offset: 0

Views

Author

Gerald McGarvey, Aug 12 2004

Keywords

Comments

The third column is A034856 (binomial(n+1, 2) + n-1).
The row sums are A014137 (partial sums of Catalan numbers (A000108)).
The "1st subdiagonal" ((i+1,i) entries) are also A014137.
The "2nd subdiagonal" ((i+2,i) entries) is A014138 ( Partial sums of Catalan numbers (starting 1,2,5,...)).
The "3rd subdiagonal" ((i+3,i) entries) is A001453 (Catalan numbers - 1.)
This is the reverse of A091491 - see A091491 for more information. The sequence of antidiagonal sums gives A124642. - Gerald McGarvey, Dec 09 2006

Examples

			Triangle begins as:
  1;
  1, 1;
  1, 2,  1;
  1, 3,  4,  1;
  1, 4,  8,  9,   1;
  1, 5, 13, 22,  23,   1;
  1, 6, 19, 41,  64,  65,   1;
  1, 7, 26, 67, 131, 196, 197, 1;
		

Crossrefs

Programs

  • Haskell
    a096465 n k = a096465_tabl !! n !! k
    a096465_row n = a096465_tabl !! n
    a096465_tabl = map reverse a091491_tabl
    -- Reinhard Zumkeller, Jul 12 2012
    
  • Magma
    A096465:= func< n,k | k eq n select 1 else (n-k)*(&+[Binomial(n+k-2*j, n-j)/(n+k-2*j): j in [0..k]]) >;
    [A096465(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Apr 30 2021
    
  • Maple
    A096465:= (n,k)-> `if`(k=n, 1, (n-k)*add(binomial(n+k-2*j, n-j)/(n+k-2*j), j=0..k));
    seq(seq(A096465(n,k), k=0..n), n=0..12) # G. C. Greubel, Apr 30 2021
  • Mathematica
    T[, 0]= 1; T[n, n_]= 1; T[n_, m_]:= T[n, m]= T[n-1, m] + T[n, m-1]; T[n_, m_] /; n < 0 || m > n = 0; Table[T[n, m], {n, 0, 12}, {m, 0, n}]//Flatten (* Jean-François Alcover, Dec 17 2012 *)
  • Sage
    def A096465(n,k): return 1 if (k==n) else (n-k)*sum( binomial(n+k-2*j, n-j)/(n+k-2*j) for j in (0..k))
    flatten([[A096465(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Apr 30 2021

Formula

From G. C. Greubel, Apr 30 2021: (Start)
T(n, k) = (n-k) * Sum_{j=0..k} binomial(n+k-2*j, n-j)/(n+k-2*j) with T(n,n) = 1.
T(n, k) = A091491(n, n-k).
Sum_{k=0..n} T(n,k) = Sum_{j=0..n} A000108(j) = A014137(n). (End)

Extensions

Offset changed by Reinhard Zumkeller, Jul 12 2012
Previous Showing 11-20 of 34 results. Next