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.

A181985 Generalized Euler numbers. Square array A(n,k), n >= 1, k >= 0, read by antidiagonals. A(n,k) = n-alternating permutations of length n*k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 19, 61, 1, 1, 1, 69, 1513, 1385, 1, 1, 1, 251, 33661, 315523, 50521, 1, 1, 1, 923, 750751, 60376809, 136085041, 2702765, 1, 1, 1, 3431, 17116009, 11593285251, 288294050521, 105261234643, 199360981, 1
Offset: 1

Views

Author

Peter Luschny, Apr 04 2012

Keywords

Comments

For an integer n > 0, a permutation s = s_1...s_k is an n-alternating permutation if it has the property that s_i < s_{i+1} if and only if n divides i.
The classical Euler numbers count 2-alternating permutations of length 2n.
Ludwig Seidel gave in 1877 an efficient algorithm to compute the coefficients of sec which carries immediately over to the computation of the generalized Euler numbers (see the Maple script).

Examples

			n\k [0][1]  [2]       [3]            [4]                 [5]
[1]  1, 1,   1,        1,             1,                   1
[2]  1, 1,   5,       61,          1385,               50521  [A000364]
[3]  1, 1,  19,     1513,        315523,           136085041  [A002115]
[4]  1, 1,  69,    33661,      60376809,        288294050521  [A211212]
[5]  1, 1, 251,   750751,   11593285251,     613498040952501
[6]  1, 1, 923, 17116009, 2301250545971, 1364944703949044401
       [A030662][A211213]   [A181991]
The (n,n)-diagonal is A181992.
		

Crossrefs

Programs

  • Maple
    A181985_list := proc(n, len) local E, dim, i, k;
    dim := n*(len-1); E := array(0..dim, 0..dim); E[0, 0] := 1;
    for i from 1 to dim do
       if i mod n = 0 then E[i, 0] := 0 ;
          for k from i-1 by -1 to 0 do E[k, i-k] := E[k+1, i-k-1] + E[k, i-k-1] od;
       else E[0, i] := 0;
          for k from 1 by 1 to i do E[k, i-k] := E[k-1, i-k+1] + E[k-1, i-k] od;
       fi od;
    seq(E[0, n*k], k=0..len-1) end:
    for n from 1 to 6 do print(A181985_list(n, 6)) od;
  • Mathematica
    nmax = 9; A181985[n_, len_] := Module[{e, dim = n*(len - 1)}, e[0, 0] = 1; For[i = 1, i <= dim, i++, If[Mod[i, n] == 0 , e[i, 0] = 0 ; For[k = i-1, k >= 0, k--, e[k, i-k] = e[k+1, i-k-1] + e[k, i-k-1] ], e[0, i] = 0; For[k = 1, k <= i, k++, e[k, i-k] = e[k-1, i-k+1] + e[k-1, i-k] ]; ]]; Table[e[0, n*k], { k, 0, len-1}]]; t = Table[A181985[n, nmax], {n, 1, nmax}]; a[n_, k_] := t[[n, k+1]]; Table[a[n-k, k], {n, 1, nmax}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Jun 27 2013, translated and adapted from Maple *)
  • Sage
    def A181985(m, n):
        shapes = ([x*m for x in p] for p in Partitions(n))
        return (-1)^n*sum((-1)^len(s)*factorial(len(s))*SetPartitions(sum(s), s).cardinality() for s in shapes)
    for m in (1..6): print([A181985(m, n) for n in (0..7)]) # Peter Luschny, Aug 10 2015

A181991 n-alternating permutations of length 4n.

Original entry on oeis.org

1, 1385, 315523, 60376809, 11593285251, 2301250545971, 472105349529479, 99537885358650089, 21451428576293883859, 4705284467293276073635, 1047067375984978044542143, 235809039854522043890582835, 53644722291938408687646120103, 12309355014854205055828909176039
Offset: 1

Views

Author

Peter Luschny, Apr 05 2012

Keywords

Comments

a(n) = A181985(n,4).

Crossrefs

Programs

  • Maple
    A181991 := proc(n) local E, dim, i, k; dim := 4*n;
    E := array(0..dim, 0..dim); E[0, 0] := 1;
    for i from 1 to dim do
    if i mod n = 0 then E[i, 0] := 0 ;
       for k from i-1 by -1 to 0 do E[k, i-k] := E[k+1, i-k-1] + E[k, i-k-1] od;
    else E[0, i] := 0;
       for k from 1 by 1 to i do E[k, i-k] := E[k-1, i-k+1] + E[k-1, i-k] od;
    fi od; E[0, dim] end:
    seq(A181991(n), n = 1..14);
    # Alternatively:
    a := (x) -> (4*x)!*(-1/(4*x)!+2/x!/(3*x)!+1/(2*x)!^2-3/x!^2/(2*x)!+1/x!^4):
    seq(a(n), n=1..14); # Peter Luschny, Aug 13 2015
  • Mathematica
    A181985[n_, len_] := Module[{e, dim = n*(len - 1)}, e[0, 0] = 1; For[i = 1, i <= dim, i++, If[Mod[i, n] == 0, e[i, 0] = 0; For[k = i - 1, k >= 0, k--, e[k, i - k] = e[k + 1, i - k - 1] + e[k, i - k - 1]], e[0, i] = 0; For[k = 1, k <= i, k++, e[k, i - k] = e[k - 1, i - k + 1] + e[k - 1, i - k]]]]; Table[e[0, n*k], {k, 0, len - 1}]]; a[n_] := A181985[n, 4 + 1][[4 + 1]]; Table[a[n], {n, 1, 14}] (* Jean-François Alcover, Dec 17 2013, after Maple code in A181985 *)

Formula

a(n) = (4*n)!*(-1/(4*n)! + 2/(n!*(3*n)!) + 1/(2*n)!^2 - 3/(n!^2*(2*n)!) + 1/n!^4). - Peter Luschny, Aug 13 2015

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