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.

A285672 Number of permutations p of [n] avoiding consecutive odd sums i+p(i), (i+1)+p(i+1) for all i in [n-1].

Original entry on oeis.org

1, 1, 1, 2, 8, 36, 180, 1008, 6336, 46080, 374400, 3369600, 32659200, 344736000, 3886444800, 47348582400, 611264102400, 8442272563200, 122595843686400, 1890952003584000, 30510694932480000, 520011800985600000, 9231875243458560000, 172292221923655680000
Offset: 0

Views

Author

Alois P. Heinz, Apr 24 2017

Keywords

Examples

			a(0) = 1: the empty permutation.
a(1) = 1: 1.
a(2) = 1: 12.
a(3) = 2: 123, 321.
a(4) = 8: 1234, 1432, 2413, 2431, 3214, 3412, 4213, 4231.
a(5) = 36: 12345, 12543, 13524, 13542, 14325, 14523, 15324, 15342, 24135, 24153, 24315, 24351, 24513, 24531, 31524, 31542, 32145, 32541, 34125, 34521, 35124, 35142, 42135, 42153, 42315, 42351, 42513, 42531, 51324, 51342, 52143, 52341, 53124, 53142, 54123, 54321.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, j, p, t) option remember; `if`(n=0, 1,
         `if`(i=0 or t=1 and p=1, 0, i*b(n-1, i-1, j, 1-p, p))+
         `if`(j=0 or t=1 and p=0, 0, j*b(n-1, i, j-1, 1-p, 1-p)))
        end:
    a:= n-> b(n, floor(n/2), ceil(n/2), 1, 0):
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, i_, j_, p_, t_] := b[n, i, j, p, t] =
         If[n==0, 1, If[i==0 || t ==1 && p==1, 0, i*b[n-1, i-1, j, 1-p, p]] +
         If[j==0 || t==1 && p==0, 0, j*b[n-1, i, j-1, 1-p, 1-p]]];
    a[n_] := b[n, Floor[n/2], Ceiling[n/2], 1, 0];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)

A231777 Number T(n,k) of permutations of [n] with exactly k ascents from odd to even numbers; triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 8, 14, 2, 54, 60, 6, 162, 402, 150, 6, 1536, 2712, 768, 24, 6144, 19704, 12744, 1704, 24, 75000, 183120, 94320, 10320, 120, 375000, 1473720, 1392720, 365520, 21720, 120, 5598720, 17522640, 13631040, 3011040, 152640, 720, 33592320, 156250800
Offset: 0

Views

Author

Alois P. Heinz, Nov 13 2013

Keywords

Examples

			T(4,0) = 8: 1324, 2413, 2431, 3241, 4132, 4213, 4231, 4321.
T(4,1) = 14: 1243, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 3124, 3142, 3214, 3421, 4123, 4312.
T(4,2) = 2: 1234, 3412.
T(5,2) = 6: 12345, 12534, 34125, 34512, 51234, 53412.
T(6,3) = 6: 123456, 125634, 341256, 345612, 561234, 563412.
Triangle T(n,k) begins:
:  0 :      1;
:  1 :      1;
:  2 :      1,       1;
:  3 :      4,       2;
:  4 :      8,      14,       2;
:  5 :     54,      60,       6;
:  6 :    162,     402,     150,      6;
:  7 :   1536,    2712,     768,     24;
:  8 :   6144,   19704,   12744,   1704,    24;
:  9 :  75000,  183120,   94320,  10320,   120;
: 10 : 375000, 1473720, 1392720, 365520, 21720, 120;
		

Crossrefs

Column k=0 gives: A231601.
Row sums and T(2n,n) give: A000142.
T(n,floor(n/2)) gives: A081123(n+1).
Cf. A004526.
Showing 1-2 of 2 results.