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.

A060005 Number of ways of partitioning the integers {1,2,..,4n} into two (unordered) sets such that the sums of parts are equal in both sets (parts in either set will add up to (4n)*(4n+1)/4). Number of solutions to {1 +- 2 +- 3 +- ... +- 4n=0}.

Original entry on oeis.org

1, 1, 7, 62, 657, 7636, 93846, 1199892, 15796439, 212681976, 2915017360, 40536016030, 570497115729, 8110661588734, 116307527411482, 1680341334827514, 24435006625667338, 357366669614512168, 5253165510907071170
Offset: 0

Views

Author

Roland Bacher, Mar 15 2001

Keywords

Examples

			a(1)=1 since there is only one way of partitioning {1,2,3,4} into two sets of equal sum, namely {1,4}, {2,3}.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; local m; m:= i*(i+1)/2;
          `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i), i-1) +b(n+i, i-1)))
        end:
    a:= n-> b(4*n, 4*n-1):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 30 2011
  • Mathematica
    b[n_, i_] := b[n, i] = Module[{m = i*(i+1)/2}, If[n > m, 0, If[n == m, 1, b[Abs[n-i], i-1] + b[n+i, i-1]]]]; a[n_] := b[4*n, 4*n-1]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Sep 26 2013, translated from Alois P. Heinz's Maple program *)

Formula

a(0)=1 and a(n) is half the coefficient of q^0 in product((q^(-k)+q^k), k=1..4*n) for n >= 1.
For n>=1, a(n) = (1/Pi)*16^n*J(4n) where J(n) = integral(t=0, Pi/2, cos(t)cos(2t)...cos(nt)dt). - Benoit Cloitre, Sep 24 2006

Extensions

More terms from Alois P. Heinz, Oct 30 2011

A168238 Number of different 0-moment rowing configurations for 4n rowers.

Original entry on oeis.org

1, 4, 29, 263, 2724, 30554, 361677, 4454273, 56546511, 735298671, 9749613914, 131377492010, 1794546880363, 24798396567242, 346130144084641, 4873560434459530, 69149450121948083, 987844051312409668, 14198028410251734447, 205181815270346718199
Offset: 1

Views

Author

Jeffrey Shallit, Nov 21 2009

Keywords

Comments

Also the number of ways to assign 2n +1's and 2n -1's to the numbers 1,2,...,4n such that the sum is 0, assuming 1 gets the sign +1.

Examples

			For n = 2 there are 4 solutions to the 8-man rowing problem.
For n=1 the unique solution is 1+4 = 2+3. For n=2 there are 4 different solutions: 1+2+7+8 = 3+4+5+6, 1+3+6+8 = 2+4+5+7, 1+4+5+8 = 2+3+6+7, 1+4+6+7 = 2+3+5+8. - _Michel Marcus_, May 25 2013
		

Crossrefs

Bisection of row n=2 of A203986. - Alois P. Heinz, Jan 09 2012
Cf. A227850.

Programs

  • Mathematica
    b[L_List] := b[L] = Module[{nL = Length[L], k = L[[-1]], m = L[[-2]]}, Which[L[[1]] == 0, If[nL == 3, 1, b[L[[2 ;; nL]]]], L[[1]] < 1, 0, True, Sum[If[L[[j]] < m, 0, b[Join[Sort[Table[L[[i]] - If[i == j, m + 1/97, 0], {i, 1, nL - 2}]], {m - 1, k}]]], {j, 1, nL - 2}]]];
    A[n_, k_] := If[n==0 || k==0, 1, b[Join[Array[(k (n k + 1)/2 + k/97)&, n], {k n, k}]]/n!];
    a[n_] := A[2, 2n];
    Array[a, 20] (* Jean-François Alcover, Aug 19 2018, after Alois P. Heinz *)

Extensions

a(6)-a(20) from Alois P. Heinz, Jan 09 2012

A073410 Number of permutations p of (1,2,3,...,n) such that 1*(-1)^p(1)+2*(-1)^p(2)+3*(-1)^p(3)+...+n*(-1)^p(n)=0.

Original entry on oeis.org

1, 0, 0, 2, 8, 0, 0, 576, 4608, 0, 0, 2505600, 30067200, 0, 0, 53444966400, 855119462400, 0, 0, 3587014803456000, 71740296069120000, 0, 0, 584198928937451520000, 14020774294498836480000, 0, 0, 196340349691596912721920000, 5497529791364713556213760000, 0, 0
Offset: 0

Views

Author

Benoit Cloitre, Aug 23 2002

Keywords

Comments

Equivalently the number of grand Dyck n-paths in which each run length is selected from {1..2*n} without replacement. - David Scambler, Apr 16 2013

Crossrefs

Cf. A227850.

Programs

  • Maple
    b:= proc(n, i, c) option remember; `if`(abs(n)>i*(i+1)/2, 0,
          `if`(i=0, `if`(abs(c)<2, 1, 0),
           b(n+i, i-1, c+1) +b(n-i, i-1, c-1)))
        end:
    a:= n-> b(0, n, 0)*floor(n/2)!*ceil(n/2)!/2^irem(n, 2):
    seq(a(n), n=0..40);  # Alois P. Heinz, Apr 29 2015
  • Mathematica
    b[n_, i_, c_] := b[n, i, c] = If[Abs[n] > i*(i+1)/2, 0, If[i == 0, If[Abs[c]<2, 1, 0], b[n+i, i-1, c+1] + b[n-i, i-1, c-1]]]; a[n_] := b[0, n, 0]*Floor[n/2]! *Ceiling[n/2]!/2^Mod[n, 2]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Jun 12 2015, after Alois P. Heinz *)
  • PARI
    a(n)=sum(k=1,n!,if(sum(i=1,n,i*(-1)^component(numtoperm(n,k),i)),0,1))

Formula

It seems that a(n)=0 if n==1 or 2 (mod 4) and a(4*k)=4*k*a(4*k-1). - Benoit Cloitre, Aug 23 2002

Extensions

More terms from John W. Layman, Feb 05 2003
a(14)-a(22) from Robert Gerbicz, Nov 22 2010
a(0), a(23)-a(30) from Alois P. Heinz, Apr 28 2015
Showing 1-3 of 3 results.