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.

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