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.

A120672 a(n) = 2 * A285917(n) for n >=2, a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 2, 12, 22, 60, 104, 252, 438, 1020, 1792, 4092, 7264, 16380, 29332, 65532, 118198, 262140, 475664, 1048572, 1912392, 4194300, 7683172, 16777212, 30850272, 67108860, 123817124, 268435452, 496754308, 1073741820, 1992366124, 4294967292, 7988854198
Offset: 0

Views

Author

Thomas Wieder, Jun 24 2006

Keywords

Comments

Previous name was: Consider a set A containing at least n-1 elements of sort "a" and a set B containing at least n-1 elements of sort "b". From set A we take i elements, from set B we take (n-i) elements such that i + (n-i) = n. Then we distribute these n elements in two urns L (left) and R (right). The order of selection among the two sorts counts. Equivalently we can say: Then we form two sequences L and R from these n elements. The position of the sort of the elements within the sequences counts. Furthermore, the occupations of the urns are permuted. In other words, the order of the sequences L and R is swapped from L|R to R|L.
A028399(n) = 2*2^n - 4 with n=1,2,3,... is an upper limit for a(n) because Sum_{i=1..n-1} 2*n!/(i!*(n-i)!) = 2*2^n - 4. a(n) follows from all distinct ordered 2-tuples of positive integers whose elements sum to n. See the first Maple program below.

Examples

			For n=3 we have a(n=3)=12 configurations [L|R] and [R|L]: [aaa|b], [b|aaa], [baa|a], [a|baa], [aba|a], [a|aba], [aab|a], [a|aab] and [bbb|a], [a|bbb], [abb|b], [b|abb], [bab|b], [b|bab], [bba|b], [b|bba].
		

Crossrefs

Programs

  • Maple
    A120672 := proc(n::integer) local i,k, cmpstnlst,cmpstn,NumberOfParts,liste, NumberOfDifferentParts,Result; k:=2; Result := 0; cmpstnlst := composition(n,k); NumberOfParts := 0; NumberOfDifferentParts := 0; for i from 1 to nops(cmpstnlst) do cmpstn := cmpstnlst[i]; NumberOfParts := nops(cmpstn); if NumberOfParts > 0 then liste := convert(cmpstn,multiset); else liste := NULL; fi; if liste <> NULL then NumberOfDifferentParts := nops(liste); else NumberOfDifferentParts := 0; fi; Result := Result + n!/mul(op(j,cmpstn)!, j=1..NumberOfParts)*(NumberOfParts!/ mul(op(2,op(j,liste))!, j=1..NumberOfDifferentParts)); od; print(Result); end proc;
    A120672 := proc(n) local i,Term,Result; Result:=0; for i from 1 to n-1 do Term:=n!/(i!*(n-i)!); if i <> n-i then Term:=2*Term; fi; Result:=Result+Term; end do; print(Result); end proc;
  • Mathematica
    a[n_] := If[n == 0, 0, 2^(n+1) - 4 - Sum[Binomial[n, Quotient[k, 2]]* (-1)^(n-k), {k, 0, n}]];
    Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Apr 02 2024, after R. J. Mathar's formula *)

Formula

For the number a(n) of such [L|R] configurations we have a(n) = n!*Sum_{i=1..n-1} delta2(i,n-i)/(i!*(n-i)!) where delta2(n,n-i) = 2 if i <> (n-i) and 1 if i = (n-i).
a(n) = A028399(n) - A126869(n), n > 0. - R. J. Mathar, Aug 07 2008

Extensions

Simpler name referring to A285917 from Joerg Arndt, Jun 25 2019

A285824 Number T(n,k) of ordered set partitions of [n] into k blocks such that equal-sized blocks are ordered with increasing least elements; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 6, 1, 0, 1, 11, 18, 1, 0, 1, 30, 75, 40, 1, 0, 1, 52, 420, 350, 75, 1, 0, 1, 126, 1218, 3080, 1225, 126, 1, 0, 1, 219, 4242, 17129, 15750, 3486, 196, 1, 0, 1, 510, 14563, 82488, 152355, 63756, 8526, 288, 1, 0, 1, 896, 42930, 464650, 1049895, 954387, 217560, 18600, 405, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 27 2017

Keywords

Examples

			T(3,1) = 1: 123.
T(3,2) = 6: 1|23, 23|1, 2|13, 13|2, 3|12, 12|3.
T(3,3) = 1: 1|2|3.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,   1;
  0, 1,   6,    1;
  0, 1,  11,   18,     1;
  0, 1,  30,   75,    40,     1;
  0, 1,  52,  420,   350,    75,    1;
  0, 1, 126, 1218,  3080,  1225,  126,   1;
  0, 1, 219, 4242, 17129, 15750, 3486, 196, 1;
  ...
		

Crossrefs

Main diagonal and first lower diagonal give: A000012, A002411.
Row sums give A120774.
T(2n,n) gives A285926.

Programs

  • Maple
    b:= proc(n, i, p) option remember; expand(`if`(n=0 or i=1,
          (p+n)!/n!*x^n, add(b(n-i*j, i-1, p+j)*x^j*combinat
          [multinomial](n, n-i*j, i$j)/j!^2, j=0..n/i)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..12);
  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!);
    b[n_, i_, p_] := b[n, i, p] = Expand[If[n == 0 || i == 1, (p + n)!/n!*x^n, Sum[b[n-i*j, i-1, p+j]*x^j*multinomial[n, Join[{n-i*j}, Table[i, j]]]/ j!^2, {j, 0, n/i}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, n, 0]];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Apr 28 2018, after Alois P. Heinz *)

A285853 Number of permutations of [n] with two ordered cycles such that equal-sized cycles are ordered with increasing least elements.

Original entry on oeis.org

1, 6, 19, 100, 508, 3528, 24876, 219168, 1980576, 21257280, 234434880, 2972885760, 38715943680, 566931294720, 8514866707200, 141468564787200, 2407290355814400, 44753976117043200, 850965783594393600, 17505896073523200000, 367844990453821440000
Offset: 2

Views

Author

Alois P. Heinz, Apr 27 2017

Keywords

Examples

			a(2) = 1: (1)(2).
a(3) = 6: (1)(23), (23)(1), (2)(13), (13)(2), (3)(12), (12)(3).
a(4) = 19: (123)(4), (4)(123), (132)(4), (4)(132), (124)(3), (3)(124), (142)(3), (3)(142), (134)(2), (2)(134), (143)(2), (2)(143), (1)(234), (234)(1), (1)(243), (243)(1),  (12)(34), (13)(24), (14)(23).
		

Crossrefs

Column k=2 of A285849.
Cf. A285917.

Programs

  • Maple
    a:= n-> 2*add(binomial(n, k)*(k-1)!*(n-k-1)!, k=1..n/2)-
            `if`(n::even, 3/2*binomial(n, n/2)*(n/2-1)!^2, 0):
    seq(a(n), n=2..25);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<5, [0, 1, 6, 19][n],
         ((2*n-1)*(n-1)*a(n-1)+(n-2)*(2*n^2-5*n-1)*a(n-2)
          -(n-3)^2*((2*n^2-5*n+4)*a(n-3)+(n-4)^2*a(n-4)))/(2*n))
        end:
    seq(a(n), n=2..25);
  • Mathematica
    Table[(n-1)!*(2*HarmonicNumber[n] - (3 + (-1)^n)/n), {n, 2, 25}] (* Vaclav Kotesovec, Apr 29 2017 *)
Showing 1-3 of 3 results.