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 13 results. Next

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

A077042 Square array read by falling antidiagonals of central polynomial coefficients: largest coefficient in expansion of (1 + x + x^2 + ... + x^(n-1))^k = ((1-x^n)/(1-x))^k, i.e., the coefficient of x^floor(k*(n-1)/2) and of x^ceiling(k*(n-1)/2); also number of compositions of floor(k*(n+1)/2) into exactly k positive integers each no more than n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 3, 3, 1, 1, 0, 1, 6, 7, 4, 1, 1, 0, 1, 10, 19, 12, 5, 1, 1, 0, 1, 20, 51, 44, 19, 6, 1, 1, 0, 1, 35, 141, 155, 85, 27, 7, 1, 1, 0, 1, 70, 393, 580, 381, 146, 37, 8, 1, 1, 0, 1, 126, 1107, 2128, 1751, 780, 231, 48, 9, 1, 1, 0, 1, 252, 3139
Offset: 0

Views

Author

Henry Bottomley, Oct 22 2002

Keywords

Comments

From Michel Marcus, Dec 01 2012: (Start)
A pair of numbers written in base n are said to be comparable if all digits of the first number are at least as big as the corresponding digit of the second number, or vice versa. Otherwise, this pair will be defined as uncomparable. A set of pairwise uncomparable integers will be called anti-hierarchic.
T(n,k) is the size of the maximal anti-hierarchic set of integers written with k digits in base n.
For example, for base n=2 and k=4 digits:
- 0 (0000) and 15 (1111) are comparable, while 6 (0110) and 9 (1001) are uncomparable,
- the maximal antihierarchic set is {3 (0011), 5 (0101), 6 (0110), 9 (1001), 10 (1010), 12 (1100)} with 6 elements that are all pairwise uncomparable. (End)

Examples

			Rows of square array start:
  1,    0,    0,    0,    0,    0,    0, ...
  1,    1,    1,    1,    1,    1,    1, ...
  1,    1,    2,    3,    6,   10,   20, ...
  1,    1,    3,    7,   19,   51,  141, ...
  1,    1,    4,   12,   44,  155,  580, ...
  1,    1,    5,   19,   85,  381, 1751, ...
  ...
Read by antidiagonals:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 1, 1;
  0, 1, 2, 1, 1;
  0, 1, 3, 3, 1, 1;
  0, 1, 6, 7, 4, 1, 1;
  ...
		

Crossrefs

Programs

Formula

By the central limit theorem, T(n,k) is roughly n^(k-1)*sqrt(6/(Pi*k)).
T(n,k) = Sum{j=0,h/n} (-1)^j*binomial(k,j)*binomial(k-1+h-n*j,k-1) with h=floor(k*(n-1)/2), k>0. - Michel Marcus, Dec 01 2012

A052456 Number of magic series of order n.

Original entry on oeis.org

1, 1, 2, 8, 86, 1394, 32134, 957332, 35154340, 1537408202, 78132541528, 4528684996756, 295011186006282, 21345627856836734, 1698954263159544138, 147553846727480002824, 13888244935445960871352, 1408407905312396429259944, 153105374581396386625831530
Offset: 0

Views

Author

Keywords

Comments

Henry Bottomley's narrowing gap could be confirmed for 2 < n <= 64. - Walter Trump, Jan 21 2005
A new algorithm was found by Robert Gerbicz. Now the enumeration of magic series of orders greater than 100 is possible. - Walter Trump, May 05 2006

Examples

			a(3) = 8 since a magic square of order 3 would require a row sum of 15=(1+2+...+9)/3 and there are 8 ways of writing 15 as the sum of three distinct positive numbers up to 9: 1+5+9, 1+6+8, 2+4+9, 2+5+8, 2+6+7, 3+4+8, 3+5+7, 4+5+6.
		

References

  • M. Kraitchik, Magic Series. Section 7.13.3 in Mathematical Recreations, New York, W. W. Norton, pp. 143 and 183-186, 1942.

Crossrefs

Cf. A007785, A052457, A052458. A100568 is the same sequence times n!.
Main diagonal of A204459. - Alois P. Heinz, Jan 18 2012

Programs

  • Mathematica
    $RecursionLimit = 1000; b[n_, i_, t_] /; i < t || n < t*((t + 1)/2) || n > t*((2*i - t + 1)/2) = 0; b[0, , ] = 1; b[n_, i_, t_] := b[n, i, t] = b[n, i - 1, t] + If[n < i, 0, b[n - i, i - 1, t - 1]]; a[, 0] = 1; a[0, ] = 0; a[n_, k_] :=  With[{s = k*(k*n + 1)}, If[Mod[s, 2] == 1, 0, b[s/2, k*n, k]]]; a[n_] := a[n] = a[n, n]; Table[Print[a[n]]; a[n], {n, 0, 18}] (* Jean-François Alcover, Aug 15 2013, after Alois P. Heinz *)

Formula

a(n) = A067059(n, n*(n-1)) = r(n, n*(n-1), n^2*(n-1)/2) where r(n, m, k) is a restricted partition function giving the number of partitions of k into at most n positive parts each no more than m. - Henry Bottomley, Feb 25 2002.
It seems a(n) (at least for 2A068606 and assuming the peak of a normal distribution = 1/sqrt(variance*2*Pi) - Henry Bottomley, Feb 25 2002.
a(n) ~ sqrt(3) * exp(n-1/2) * n^(n-3) / Pi. - Vaclav Kotesovec, Sep 05 2014

Extensions

Edited and ten more terms from Henry Bottomley, Feb 16 2002
Terms through a(36) added to attached web page, Feb 04 2005

A002838 Balancing weights on the integer line.

Original entry on oeis.org

1, 2, 5, 12, 32, 94, 289, 910, 2934, 9686, 32540, 110780, 381676, 1328980, 4669367, 16535154, 58965214, 211591218, 763535450, 2769176514, 10089240974, 36912710568, 135565151486, 499619269774, 1847267563742, 6850369296298
Offset: 1

Views

Author

Keywords

Comments

Also number of partitions of n(n+1)/2 into up to n parts each no greater than n+1, partitions of n(n+3)/2 into exactly n parts each no greater than n+2 and partitions of n(n+1) into exactly n distinct parts each no greater than 2n+1, thus providing balancing solutions for n weights in distinct integer positions on [ -n,n] with a pivot at 0. - Henry Bottomley, Aug 09 2002
Is this a shifted version of A076822? - Vladimir Reshetnikov, Oct 06 2016

References

  • 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

Cf. A047997, A076822, A188181 (columns 1, 2).

Programs

  • Mathematica
    (* This program is not convenient for large values of n *) a[n_] := Length[ IntegerPartitions[n*(n+1)/2, n, Range[n+1]]]; Table[ Print[{n, an = a[n]}]; an, {n, 1, 16}] (* Jean-François Alcover, Jan 02 2013 *)

Formula

a(n) = A047997(n, n) = A067059(n, n+1). a(n) tends towards (sqrt(12)/Pi)*4^n/n^2 and something like (sqrt(12)/Pi)*4^n/(n^2+1.85*n+0.8) seems to give an even closer approximation. - Henry Bottomley, Aug 09 2002

Extensions

More terms from Henry Bottomley, Aug 09 2002

A029895 Number of partitions of floor(n^2/2) with at most n parts and maximal height n.

Original entry on oeis.org

1, 1, 2, 3, 8, 20, 58, 169, 526, 1667, 5448, 18084, 61108, 208960, 723354, 2527074, 8908546, 31630390, 113093022, 406680465, 1470597342, 5342750699, 19499227828, 71442850111, 262754984020, 969548468960, 3589093760726, 13323571588607, 49596793134484
Offset: 0

Views

Author

torsten.sillke(AT)lhsystems.com

Keywords

Comments

This is the maximum value for the distribution of partitions of (0 .. n^2) that fit in an n X n box; assuming the peak of a normal distribution 1/sqrt(variance*2*Pi) approximates to these partitions and using A068606 suggests C(2n,n)*sqrt(6/(Pi*n^2*(2n+1))) could be an approximation [within 0.3% for a(100)=88064925963069745337300842293630181021718294488842002448]; using Stirling's approximation gives the simpler (sqrt(3)/Pi)*4^n/n^2 [about 0.6% away for a(100)] though experimentation suggests that something like (sqrt(3)/Pi)*4^n/(n^2+3n/5+1/5) is closer [about 0.0001% away for a(100)]. - Henry Bottomley, Mar 13 2002
Bisection of A277218 with even indexes. - Vladimir Reshetnikov, Oct 09 2016

Examples

			a(4)=8 because the partitions of Floor[4^2 /2] that fit inside a 4 X 4 box are {4, 4}, {4, 3, 1}, {4, 2, 2}, {4, 2, 1, 1}, {3, 3, 2}, {3, 3, 1, 1}, {3, 2, 2, 1}, {2, 2, 2, 2}.
		

References

  • R. A. Brualdi, H. J. Ryser, Combinatorial Matrix Theory, Cambridge Univ. Press, 1992.

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Expand[FunctionExpand[QBinomial[2 n, n, q]]], q, Floor[n^2/2]], {n, 0, 30}] (* Vladimir Reshetnikov, Oct 09 2016 *)
  • PARI
    {a(n)=if(n==0,1,polcoeff(prod(i=1,n,(1-q^(n+i))/(1-q^i)),n^2\2,q))} \\ Paul D. Hanna, Feb 15 2007

Formula

Calculated using Cor. 6.3.3, Th. 6.3.6, Cor. 6.2.5 of Brualdi-Ryser. Table[T[Floor[n^2/2], n, n], {n, 0, 36}] with T[ ] defined as in A047993. a(n)=A067059(n, n).
a(n) equals the central coefficient of q in the central q-binomial coefficients for n>0: a(n) = [q^([n^2/2])] Product_{i=1..n} (1-q^(n+i))/(1-q^i), with a(0)=1. - Paul D. Hanna, Feb 15 2007

Extensions

More terms and comments from Wouter Meeussen, Aug 14 2001
Edited by Henry Bottomley, Feb 17 2002
a(27)-a(28) from Alois P. Heinz, Oct 31 2018

A063074 Number of partitions of 2n^2 whose Ferrers-plot fits within a 2n X 2n box; number of ways to cut a 2n X 2n chessboard into two equal-area pieces along a non-descending line from lower left to upper right.

Original entry on oeis.org

1, 2, 8, 58, 526, 5448, 61108, 723354, 8908546, 113093022, 1470597342, 19499227828, 262754984020, 3589093760726, 49596793134484, 692260288169282, 9747120868919060, 138298900243896166, 1975688102624819336, 28396056820503468894, 410363630540693436398
Offset: 0

Views

Author

Wouter Meeussen, Aug 03 2001

Keywords

Comments

Also the number of subsets of {1,...,4*n} containing exactly 2*n elements with total sum n*(4*n+1) (see also A060468 for a related sequence). This is of course the same as the number of partitions of n*(4*n+1) having 2*n distinct parts of length at most 4*n. This number is the coefficient of t^0 q^0 in Product_{k=1..4*n} (t*q^k + 1/(t*q^k)). - Roland Bacher, May 02 2002
A bijection with a dissection as above of the 2n X 2n checkerboard is given by subtracting 1,2,3,...,2n of the smallest, second-smallest, etc. element in the subset. Example for n=2: {1,2,7,8} (yields the checkerboard partition {1-1,2-2,7-3,8-4}={0,0,4,4}), {1,3,6,8} (yields {1-1,3-2,6-3,8-4}={0,1,3,4}), {1,4,5,8} (yields {0,2,2,4}), {1,4,6,7} (yields {0,2,3,3}), {3,4,5,6} (yields {2,2,2,2}), {2,4,5,7} (yields {1,2,2,3}), {2,3,6,7} (yields {1,1,3,3}), {2,3,5,8} (yields {1,1,2,4}).
Appears to be the number of random walks of length 4n, moves +/-1, starting and ending at 0 and with signed area 0 under the path. It would be nice to have a lower bound of the form a(n) > c*2^{4n}/n^d. - David_Mumford(AT)brown.edu, Jun 25 2003

Examples

			For a 4 X 4 board (n=2) the 8 partitions are (4,4,0,0), (4,3,1,0), (4,2,1,1), (4,2,2,0), (3,3,2,0), (3,3,1,1), (3,2,2,1), (2,2,2,2).
		

Crossrefs

Bisection of row n=2 of A204459. - Alois P. Heinz, Jan 18 2012

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(4*n+1), 4*n, 2*n):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 18 2012
  • Mathematica
    Table[ Length@Select[ IntegerPartitions[ 2n^2 ], Length[ # ] <= 2n && First[ # ] <= 2n& ], {n, 1, 5} ] or faster: Table[ T[ 2n^2, 2n, 2n ], {n, 0, 24} ] with T[ m, a, b ] as defined in A047993.
    (* second program: *)
    b[n_, i_, t_] := b[n, i, t] =  If[i < t || n < t (t + 1)/2 || n > t (2i - t + 1)/2, 0, If[n == 0, 1, b[n, i - 1, t] + If[n < i, 0, b[n - i, i - 1, t - 1]]]]; a[n_] := b[n (4n + 1), 4n, 2n]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)

Formula

a(n) = A029895(2n) = A067059(2n, 2n) = A107110(2n, 2n^2). a(n) seems to be close to (sqrt(75)/Pi)*16^n/(20n^2+6n+1). - Henry Bottomley, May 12 2005

Extensions

More terms from Alois P. Heinz, Jan 18 2012

A076822 Number of partitions of the n-th triangular number involving only the numbers 1..n and with exactly n terms.

Original entry on oeis.org

1, 1, 1, 2, 5, 12, 32, 94, 289, 910, 2934, 9686, 32540, 110780, 381676, 1328980, 4669367, 16535154, 58965214, 211591218, 763535450, 2769176514, 10089240974, 36912710568, 135565151486, 499619269774, 1847267563742, 6850369296298
Offset: 0

Views

Author

Jon Perry, Nov 19 2002

Keywords

Comments

Asymptotic to (sqrt(3)/(2*Pi))*(4^n/n^2). It is the number of lattice paths from (0,0) to (n,n-1) with steps only to the right or upward and having area n(n-1)/2 between the path and the x-axis. In the reference by Takács use formula (77) with a=n, b=n(n-1)/2 and then Stirling's formula. - Kent E. Morrison, May 28 2016
a(n) is the number of fair dice with n sides and expected value (n+1)/2 with distinct composition of numbers between 1 and n. - Felix Huber, Aug 02 2024

Examples

			a(4)=5 as T(4)=10= 1+1+4+4 =1+2+3+4 = 1+3+3+3 = 2+2+2+4 = 2+2+3+3.
		

Crossrefs

Cf. A002838. [From R. J. Mathar, Sep 20 2008]
Cf. A188181 (columns 1, 2).

Programs

  • JavaScript
    ccc=new Array(); cccc=0;
    for (n=1; n<11; n++)
    {
        str='cc=0; for (i1=1; i1<'+(n+1)+'; i1++)';
        str2='i1';
        str3='i1';
        tn=1;
        for (i=2; i<=n; i++)
        {
            str+='for (i'+i+'=i'+(i-1)+'; i'+i+'<'+(n+1)+'; i'+i+'++)';
            str2+='+i'+i;
            str3+=', ", ", i'+i;
            tn+=i;
        }
        str+='if ('+str2+'=='+tn+') document.print(++cc, ":", '+str3+', "
    ")'; eval(str); ccc[cccc++ ]=cc; document.print('****
    '); } document.write(ccc);
  • Mathematica
    f[n_] := Block[{p = IntegerPartitions[n(n + 1)/2, n]}, Length[ Select[p, Length[ # ] == n &]]]; Table[ f[n], {n, 1, 13}]

Formula

a(n) = A067059(n,n+1); also a(n) = T[n*(n-1)/2, n-1, n] with T[ ] defined as in A047993. - Martin Fuller, Jun 27 2006

Extensions

Edited and extended to 12 terms by Robert G. Wilson v, Nov 23 2002
Further terms from Max Alekseyev, May 24 2007
a(0)=1 prepended by Alois P. Heinz, May 28 2016

A001981 Restricted partitions.

Original entry on oeis.org

1, 1, 5, 13, 33, 73, 151, 289, 526, 910, 1514, 2430, 3788, 5744, 8512, 12346, 17575, 24591, 33885, 46029, 61731, 81805, 107233, 139143, 178870, 227930, 288100, 361384, 450096, 556834, 684572, 836618, 1016737, 1229093, 1478379, 1769773
Offset: 0

Views

Author

Keywords

Comments

Number of partitions of 4n into up to 8 parts each no more than n; or partitions of 4n into up to n parts each no more than 8; or partitions of 5n into exactly n single-digit parts; or partitions of 4(n+2) into exactly 8 parts each no more than n+1; or partitions of 4(n+9) into exactly 8 distinct parts each no more than n+8; etc. Points lie on 252 different septics with the pattern repeating every 420 points, amounting to 4 sets of parallel septics depending on whether n mod 6 is in {0}, {1,5}, {2,4} or {3}.
Also, the dimension of the vector space of homogeneous covariants of degree n for the binary form of degree 8. - Leonid Bedratyuk, Dec 06 2006

Examples

			a(3)=13 since partitions of 12 into up to 8 parts each no more than 3 are 3+3+3+3 = 3+3+3+2+1 = 3+3+3+1+1+1 = 3+3+2+2+2 = 3+3+2+2+1+1 = 3+3+2+1+1+1+1 = 3+3+1+1+1+1+1+1 = 3+2+2+2+2+1 = 3+2+2+2+1+1+1 = 3+2+2+1+1+1+1+1 = 2+2+2+2+2+2 = 2+2+2+2+2+1+1 = 2+2+2+2+1+1+1+1; or equivalently partitions of 15 into exactly 3 single-digit numbers are 9+5+1 = 9+4+2 = 9+3+3 = 8+6+1 = 8+5+2 = 8+4+3 = 7+7+1 = 7+6+2 = 7+5+3 = 7+4+4 = 6+6+3 = 6+5+4 =5+5+5.
		

References

  • A. Cayley, Numerical tables supplementary to second memoir on quantics, Collected Mathematical Papers. Vols. 1-13, Cambridge Univ. Press, London, 1889-1897, Vol. 2, pp. 276-281.
  • Hilbert, D., Theory of algebraic invariants. Lectures. Cambridge University Press, (1993).
  • 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).
  • Springer, T.A., Invariant theory, Lecture Notes in Mathematics, 585, Springer-Verlag, (1977).

Programs

  • Maple
    a:= n-> subs({x=1}, convert(series((product('1-x^i', 'i'=9..8+n)/ product('1-x^k', 'k'=2..n)), x, 4*n+1), polynom)): seq (a(n), n=0..40); # Leonid Bedratyuk, Dec 06 2006
  • Mathematica
    a[n_] := Length[IntegerPartitions[4*n, 8, Range[n]]]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 17 2014 *)

Formula

a(n) =A067059(n, 8) =A067059(8, n) =(1/152409600) * (1812n^7 + 57078n^6 + 748314n^5 + 5278770n^4 + 21727272n^3 + 52982181n^2 + 77609245n + 66220839 + (297675n^2+2679075n+27088425)*(1, -1)pcr(n, 2) + (1254400*n+5644800)*(2, -1, -1)pcr(n, 3) + 9408000*(0, -1, 1)pcr(n, 3) + 4762800*(1, 1, -1, -1)pcr(n, 4) + 24385536*(1, -1, 0, 0, 0)pcr(n, 5) + 6220800(3, -1, 2, -2, 1, -3, 0)pcr(n, 7)) where for example (0, -1, 1)pcr(n, 3) means the value 0 if n mod 3 = 0, the value -1 if n mod 3 = 1 and the value 1 if n mod 3 = 2. - Henry Bottomley, Jul 19 2003

Extensions

Edited by Henry Bottomley, Jul 19 2003

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

A109655 Number of partitions of n^2 into up to n parts each no more than 2n, or of n(3n+1)/2 into exactly n distinct parts each no more than 3n.

Original entry on oeis.org

1, 1, 3, 8, 33, 141, 676, 3370, 17575, 94257, 517971, 2900900, 16509188, 95220378, 555546058, 3273480400, 19456066175, 116521302221, 702567455381, 4261765991164, 25992285913221, 159303547578873, 980701254662294, 6061894625462492, 37609015174472628
Offset: 0

Views

Author

Henry Bottomley, Aug 05 2005

Keywords

Examples

			a(3) = 8 since 3^2=9 can be partitioned into 3+3+3, 4+3+2, 4+4+1, 5+4, 5+3+1, 5+2+2, 6+3, or 6+2+1, while 3*(3*3+1)/2=15 can be partitioned into 6+5+4, 7+5+3, 7+6+2, 8+6+1, 8+5+2, 8+4+3, 9+5+1, or 9+4+2.
		

Crossrefs

Cf. A161407. - Reinhard Zumkeller, Jun 10 2009
Row n=3 of A204459. - Alois P. Heinz, Jan 18 2012

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(it*(2*i-t+1)/2, 0,
          `if`(n=0, 1, b(n, i-1, t) +`if`(n b(n*(3*n+1)/2, 3*n, n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Jan 18 2012
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[it*(2*i-t+1)/2, 0, If[n == 0, 1, b[n, i-1, t] + If[nJean-François Alcover, Oct 05 2015, after Alois P. Heinz *)

Formula

a(n) = A067059(n,2n) = A067059(2n,n).
Slightly less than but close to (27/4)^n*sqrt(3)/(2*Pi*n^2).

Extensions

More terms from Alois P. Heinz, Jan 18 2012
Showing 1-10 of 13 results. Next