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

A318144 T(n, k) = (-1)^k*k!*P(n, k), where P(n, k) is the number of partitions of n of length k. Triangle read by rows, 0 <= k <= n.

Original entry on oeis.org

1, 0, -1, 0, -1, 2, 0, -1, 2, -6, 0, -1, 4, -6, 24, 0, -1, 4, -12, 24, -120, 0, -1, 6, -18, 48, -120, 720, 0, -1, 6, -24, 72, -240, 720, -5040, 0, -1, 8, -30, 120, -360, 1440, -5040, 40320, 0, -1, 8, -42, 144, -600, 2160, -10080, 40320, -362880
Offset: 0

Views

Author

Peter Luschny, Aug 20 2018

Keywords

Examples

			[0] [1],
[1] [0, -1],
[2] [0, -1, 2],
[3] [0, -1, 2,  -6],
[4] [0, -1, 4,  -6,  24],
[5] [0, -1, 4, -12,  24, -120],
[6] [0, -1, 6, -18,  48, -120,  720],
[7] [0, -1, 6, -24,  72, -240,  720,  -5040],
[8] [0, -1, 8, -30, 120, -360, 1440,  -5040, 40320],
[9] [0, -1, 8, -42, 144, -600, 2160, -10080, 40320, -362880]
		

Crossrefs

Row sums are A260845, absolute row sums are A101880.

Programs

  • Magma
    /* As triangle: */
    [[(-1)^k*#Partitions(n,k)*Factorial(k): k in [0..n]]: n in [0..10]]; // Bruno Berselli, Aug 20 2018
  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i>1,
          b(n, i-1), 0)+expand(b(n-i, min(n-i, i))*x))
        end:
    T:= n-> (p-> seq(i!*coeff(p, x, i)*(-1)^i, i=0..n))(b(n$2)):
    seq(T(n), n=0..14);  # Alois P. Heinz, Sep 18 2019
  • Mathematica
    t[n_, k_] := (-1)^k  k! (IntegerPartitions[n, {k}] // Length);
    Table[t[n, k], {n, 0, 9}, {k, 0, n}] // Flatten
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i > 1,
         b[n, i - 1], 0] + Expand[b[n - i, Min[n - i, i]]*x]];
    T[n_] := Function[p, Table[i!*Coefficient[p, x, i]*(-1)^i, {i, 0, n}]][ b[n, n]];
    T /@ Range[0, 14] // Flatten (* Jean-François Alcover, Jun 07 2021, after Alois P. Heinz *)
  • Sage
    from sage.combinat.partition import number_of_partitions_length
    def A318144row(n):
        return [(-1)^k*number_of_partitions_length(n, k)*factorial(k) for k in (0..n)]
    for n in (0..9): print(A318144row(n))
    

A260877 Square array read by ascending antidiagonals: number of m-shape Euler numbers.

Original entry on oeis.org

1, 1, -1, 1, -1, 1, 1, -1, 1, -5, 1, -1, 5, -1, 21, 1, -1, 19, -61, 1, -105, 1, -1, 69, -1513, 1385, -1, 635, 1, -1, 251, -33661, 315523, -50521, 1, -4507, 1, -1, 923, -750751, 60376809, -136085041, 2702765, -1, 36457, 1, -1, 3431, -17116009, 11593285251
Offset: 1

Views

Author

Peter Luschny, Aug 09 2015

Keywords

Comments

A set partition of m-shape is a partition of a set with cardinality m*n for some n >= 0 such that the sizes of the blocks are m times the parts of the integer partitions of n. It is ordered if the positions of the blocks are taken into account.
M-shape Euler numbers count the ordered m-shape set partitions which have even length minus the number of such partitions which have odd length.
If m=0 all possible sizes are zero. Thus m-shape Euler numbers count the ordered integer partitions of n into an even number of parts minus the number of ordered integer partitions of n into an odd number of parts (A260845).
If m=1 the set is {1,2,...,n} and the set of all possible sizes are the integer partitions of n. Thus the Euler numbers count the ordered set partitions which have even length minus the set partitions which have odd length (A033999).
If m=2 the set is {1,2,...,2n} and the 2-shape Euler numbers count the ordered set partitions with even blocks which have even length minus the number of partitions with even blocks which have odd length (A028296).

Examples

			[ n ] [0   1   2       3         4              5                 6]
[ m ] --------------------------------------------------------------
[ 0 ] [1, -1,  1,     -5,       21,          -105,              635] A260845
[ 1 ] [1, -1,  1,     -1,        1,            -1,                1] A033999
[ 2 ] [1, -1,  5,    -61,     1385,        -50521,          2702765] A028296
[ 3 ] [1, -1, 19,  -1513,   315523,    -136085041,     105261234643] A002115
[ 4 ] [1, -1, 69, -33661, 60376809, -288294050521, 3019098162602349] A211212
         A030662,A211213,  A181991,
For example the number of ordered set partitions of {1,2,...,9} with sizes in [9], [6,3] and [3,3,3] are 1, 168, 1680 respectively. Thus A(3,3) = -1 + 168 - 1680 = -1513.
Formatted as a triangle:
[1]
[1, -1]
[1, -1,  1]
[1, -1,  1,    -5]
[1, -1,  5,    -1,   21]
[1, -1, 19,   -61,    1, -105]
[1, -1, 69, -1513, 1385,   -1, 635]
		

Crossrefs

Programs

  • Sage
    def A260877(m,n):
        shapes = ([x*m for x in p] for p in Partitions(n).list())
        return sum((-1)^len(s)*factorial(len(s))*SetPartitions(sum(s), s). cardinality() for s in shapes)
    for m in (0..5): print([A260877(m,n) for n in (0..7)])
Showing 1-2 of 2 results.