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

A180191 Number of permutations of [n] having at least one succession. A succession of a permutation p is a position i such that p(i+1)-p(i) = 1.

Original entry on oeis.org

0, 1, 3, 13, 67, 411, 2921, 23633, 214551, 2160343, 23897269, 288102189, 3760013027, 52816397219, 794536751217, 12744659120521, 217140271564591, 3916221952414383, 74539067188152941, 1493136645424092773, 31400620285465593339, 691708660911435955579
Offset: 1

Views

Author

Emeric Deutsch, Sep 07 2010

Keywords

Comments

a(n) = A180190(n,1).
a(n+2) = p(n+2) where p(x) is the unique degree-n polynomial such that p(k) = k! for k = 1, ..., n+1. - Michael Somos, Jan 05 2012
From Jon Perry, Jan 04 2013: (Start)
Number of permutations of {1,...,n-1,n+1} with at least one indexed point p(k)=k with 1<=k<=n. Note that this means p(k)=n+1 is never an indexed point as k
For n>1, a(n) is the number of permutations of [n+1] that have a fixed point and contain 12; for example the a(3)=3 such permutations of {1,2,3,4} are 1234, 1243, and 3124.
(End)
For n > 0: row sums of triangle A116853. - Reinhard Zumkeller, Aug 31 2014

Examples

			x^2 + 3*x^3 + 13*x^4 + 67*x^5 + 411*x^6 + 2921*x^7 + 23633*x^8 + ...
a(3) = 3 because we have 123, 312, and 231; the permutations 132, 213, and 321 have no successions.
a(4) = 13 since p(x) = (3*x^2 - 7*x + 6) / 2 interpolates p(1) = 1, p(2) = 2, p(3) = 6, and p(4) = 13. - _Michael Somos_, Jan 05 2012
		

Crossrefs

Column k=1 of A306234, A306461, and of A324362(n-1).

Programs

  • Haskell
    a180191 n = if n == 1 then 0 else sum $ a116853_row (n - 1)
    -- Reinhard Zumkeller, Aug 31 2014
  • Maple
    d[0] := 1: for n to 50 do d[n] := n*d[n-1]+(-1)^n end do: seq(factorial(n)-d[n]-d[n-1], n = 1 .. 22);
  • Mathematica
    f[n_] := Sum[ -(-1)^k (n - k)! Binomial[n - 1, k], {k, 1, n}]; Array[f, 20] (* Robert G. Wilson v, Oct 16 2010 *)
  • PARI
    {a(n) = if( n<2, 0, n--; subst( polinterpolate( vector( n, k, k!)), x, n+1))} /* Michael Somos, Jan 05 2012 */
    

Formula

a(n) = n! - d(n) - d(n-1), where d(j) = A000166(j) are the derangement numbers.
a(n) = n! - A000255(n-1) = A002467(n) - A000166(n-1). - Jon Perry, Jan 05 2013
a(n) = (n-1)! [x^(n-1)] (1-exp(-x))/(1-x)^2. - Alois P. Heinz, Feb 23 2019

A306234 Number T(n,k) of occurrences of k in a (signed) displacement set of a permutation of [n] divided by |k|!; triangle T(n,k), n>=1, 1-n<=k<=n-1, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 4, 3, 1, 1, 5, 13, 15, 13, 5, 1, 1, 7, 28, 67, 76, 67, 28, 7, 1, 1, 9, 49, 179, 411, 455, 411, 179, 49, 9, 1, 1, 11, 76, 375, 1306, 2921, 3186, 2921, 1306, 375, 76, 11, 1, 1, 13, 109, 679, 3181, 10757, 23633, 25487, 23633, 10757, 3181, 679, 109, 13, 1
Offset: 1

Author

Alois P. Heinz, Feb 17 2019

Keywords

Examples

			Triangle T(n,k) begins:
  :                                 1                              ;
  :                           1,    1,    1                        ;
  :                     1,    3,    4,    3,    1                  ;
  :               1,    5,   13,   15,   13,    5,   1             ;
  :          1,   7,   28,   67,   76,   67,   28,   7,  1         ;
  :      1,  9,  49,  179,  411,  455,  411,  179,  49,  9,  1     ;
  :  1, 11, 76, 375, 1306, 2921, 3186, 2921, 1306, 375, 76, 11, 1  ;
		

Crossrefs

Columns k=0-10 give (offsets may differ): A002467, A180191, A324352, A324353, A324354, A324355, A324356, A324357, A324358, A324359, A324360.
Row sums give A306525.
T(n+1,n) gives A000012.
T(n+2,n) gives A005408.
T(n+2,n-1) gives A056107.
T(2n,n) gives A324361.

Programs

  • Maple
    b:= proc(s, d) option remember; (n-> `if`(n=0, add(x^j, j=d),
          add(b(s minus {i}, d union {n-i}), i=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i)/abs(i)!, i=1-n..n-1))(b({$1..n}, {})):
    seq(T(n), n=1..8);
    # second Maple program:
    T:= (n, k)-> -add((-1)^j*binomial(n-abs(k), j)*(n-j)!, j=1..n)/abs(k)!:
    seq(seq(T(n, k), k=1-n..n-1), n=1..9);
  • Mathematica
    T[n_, k_] := (-1/Abs[k]!) Sum[(-1)^j Binomial[n-Abs[k], j] (n-j)!, {j, 1, n}];
    Table[T[n, k], {n, 1, 9}, {k, 1-n, n-1}] // Flatten (* Jean-François Alcover, Feb 15 2021 *)

Formula

T(n,k) = T(n,-k).
T(n,k) = -1/|k|! * Sum_{j=1..n} (-1)^j * binomial(n-|k|,j) * (n-j)!.
T(n,k) = (n-|k|)! [x^(n-|k|)] (1-exp(-x))/(1-x)^(|k|+1).
T(n+1,n) = 1.
T(n,k) = A306461(n,k) / |k|!.
Sum_{k=1-n..n-1} |k|! * T(n,k) = A306455(n).

A306506 Number T(n,k) of permutations p of [n] having at least one index i with |p(i)-i| = k; triangle T(n,k), n>=1, 0<=k<=n-1, read by rows.

Original entry on oeis.org

1, 1, 1, 4, 4, 3, 15, 19, 15, 10, 76, 99, 86, 67, 42, 455, 603, 544, 455, 358, 216, 3186, 4248, 3934, 3486, 2921, 2250, 1320, 25487, 34115, 32079, 29296, 25487, 21514, 16296, 9360, 229384, 307875, 292509, 272064, 245806, 214551, 179058, 133800, 75600
Offset: 1

Author

Alois P. Heinz, Feb 20 2019

Keywords

Comments

T(n,k) is defined for n,k>=0. The triangle contains only the terms with k=n.

Examples

			The 6 permutations p of [3]: 123, 132, 213, 231, 312, 321 have absolute displacement sets {|p(i)-i|, i=1..3}: {0}, {0,1}, {0,1}, {1,2}, {1,2}, {0,2}, respectively. Number 0 occurs four times, 1 occurs four times, and 2 occurs thrice. So row n=3 is [4, 4, 3].
Triangle T(n,k) begins:
      1;
      1,     1;
      4,     4,     3;
     15,    19,    15,    10;
     76,    99,    86,    67,    42;
    455,   603,   544,   455,   358,   216;
   3186,  4248,  3934,  3486,  2921,  2250,  1320;
  25487, 34115, 32079, 29296, 25487, 21514, 16296, 9360;
  ...
		

Crossrefs

Columns k=0-3 give: A002467, A306511, A306524, A324366.
T(n+2,n+1) gives A007680 (for n>=0).
T(2n,n) gives A306675.

Programs

  • Maple
    b:= proc(s, d) option remember; (n-> `if`(n=0, add(x^j, j=d),
          add(b(s minus {i}, d union {abs(n-i)}), i=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b({$1..n}, {})):
    seq(T(n), n=1..9);
    # second Maple program:
    T:= proc(n, k) option remember; n!-LinearAlgebra[Permanent](
          Matrix(n, (i, j)-> `if`(abs(i-j)=k, 0, 1)))
        end:
    seq(seq(T(n, k), k=0..n-1), n=1..9);
  • Mathematica
    T[n_, k_] := n!-Permanent[Table[If[Abs[i-j]==k, 0, 1], {i, 1, n}, {j, 1, n} ]];
    Table[T[n, k], {n, 1, 9}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, May 01 2019, from 2nd Maple program *)

Formula

T(n,k) = n! - A306512(n,k).
T(2n,n) = T(2n,0) = A002467(2n) = (2n)! - A306535(n).

A306455 Total number of covered falling diagonals in all n X n permutation matrices.

Original entry on oeis.org

0, 1, 3, 14, 73, 454, 3253, 26480, 241505, 2440538, 27075301, 327197452, 4278799105, 60205974230, 907025841317, 14567520651224, 248474458923073, 4485765986251570, 85454391074596165, 1713134893536617348, 36052727133118151201, 794697884305583064302
Offset: 0

Author

Alois P. Heinz, Feb 16 2019

Keywords

Comments

A covered diagonal in a permutation matrix contains at least one 1.
Alternatively: Total number of covered raising diagonals in all n X n permutation matrices.
Also one half of the total number of all covered diagonals in all n X n permutation matrices.
Sum over all permutations p of [n] of the cardinality of the (signed) displacement set {p(i)-i, i=1..n}.
Alternatively: Sum over all permutations p of [n] of the cardinality of the set {p(i)+i, i=1..n}.

Examples

			The 6 permutations p of [3]: 123, 132, 213, 231, 312, 321 have (signed) displacement sets {p(i)-i, i=1..3}: {0}, {-1,0,1}, {-1,0,1}, {-2,1}, {-1,2}, {-2,0,2}, representing the indices of covered falling diagonals in the permutation matrices
  [1    ]  [1    ]  [  1  ]  [  1  ]  [    1]  [    1]
  [  1  ]  [    1]  [1    ]  [    1]  [1    ]  [  1  ]
  [    1]  [  1  ]  [    1]  [1    ]  [  1  ]  [1    ] , respectively, the sum of the set cardinalities gives a(3) = 1 + 3 + 3 + 2 + 2 + 3 = 14.
		

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, n*(n+1)/2,
          ((2*n^2-5*n+1)*a(n-1)-(n-1)*(n^2-4*n+2)*a(n-2)
          -(n-2)*(n-1)^2*a(n-3))/(n-2))
        end:
    seq(a(n), n=0..23);
  • Mathematica
    a[n_] := a[n] = If[n<3, n(n+1)/2, ((2n^2-5n+1) a[n-1] -
       (n-1)(n^2-4n+2) a[n-2] - (n-2)(n-1)^2 a[n-3])/(n-2)];
    a /@ Range[0, 23] (* Jean-François Alcover, Aug 24 2021, after Alois P. Heinz *)

Formula

E.g.f.: (exp(-x)*(x+1)+x-1)/(x-1)^2.
a(n) = ((2*n^2-5*n+1)*a(n-1) - (n-1)*(n^2-4*n+2)*a(n-2) - (n-2)*(n-1)^2*a(n-3)) / (n-2) for n > 2, a(n) = n*(n+1)/2 for n < 3.
a(n) = Sum_{k=1..n} k * A125182(n,k).
a(n) = A259834(n+2) - n!.
a(n) = Sum_{k=1-n..n-1} A306461(n,k).
a(n) = Sum_{k=1-n..n-1} |k|! * A306234(n,k).
a(n) mod 2 = 1 - (n mod 2) = A059841(n) for n >= 2.

A324225 Total number T(n,k) of 1's in falling diagonals with index k in all n X n permutation matrices; triangle T(n,k), n>=1, 1-n<=k<=n-1, read by rows.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 6, 4, 2, 6, 12, 18, 24, 18, 12, 6, 24, 48, 72, 96, 120, 96, 72, 48, 24, 120, 240, 360, 480, 600, 720, 600, 480, 360, 240, 120, 720, 1440, 2160, 2880, 3600, 4320, 5040, 4320, 3600, 2880, 2160, 1440, 720, 5040, 10080, 15120, 20160, 25200, 30240, 35280, 40320, 35280, 30240, 25200, 20160, 15120, 10080, 5040
Offset: 1

Author

Alois P. Heinz, Feb 18 2019

Keywords

Comments

T(n,k) is the number of occurrences of k in all (signed) displacement lists [p(i)-i, i=1..n] of permutations p of [n].

Examples

			The 6 permutations p of [3]: 123, 132, 213, 231, 312, 321 have (signed) displacement lists [p(i)-i, i=1..3]: [0,0,0], [0,1,-1], [1,-1,0], [1,1,-2], [2,-1,-1], [2,0,-2], representing the indices of falling diagonals of 1's in the permutation matrices
  [1    ]  [1    ]  [  1  ]  [  1  ]  [    1]  [    1]
  [  1  ]  [    1]  [1    ]  [    1]  [1    ]  [  1  ]
  [    1]  [  1  ]  [    1]  [1    ]  [  1  ]  [1    ] , respectively. Indices -2 and 2 occur twice, -1 and 1 occur four times, and 0 occurs six times. So row n=3 is [2, 4, 6, 4, 2].
Triangle T(n,k) begins:
  :                             1                           ;
  :                        1,   2,   1                      ;
  :                   2,   4,   6,   4,   2                 ;
  :              6,  12,  18,  24,  18,  12,   6            ;
  :        24,  48,  72,  96, 120,  96,  72,  48,  24       ;
  :  120, 240, 360, 480, 600, 720, 600, 480, 360, 240, 120  ;
		

Crossrefs

Columns k=0-6 give (offsets may differ): A000142, A001563, A062119, A052571, A052520, A282822, A052521.
Row sums give A001563.
T(n+1,n) gives A000142.
T(n+1,n-1) gives A052849.
T(n+1,n-2) gives A052560 for n>1.
Cf. A152883 (right half of this triangle without center column), A162608 (left half of this triangle), A306461, A324224.
Cf. A001710.

Programs

  • Maple
    b:= proc(s, c) option remember; (n-> `if`(n=0, c,
          add(b(s minus {i}, c+x^(n-i)), i=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1-n..n-1))(b({$1..n}, 0)):
    seq(T(n), n=1..8);
    # second Maple program:
    egf:= k-> (t-> x^t/t*hypergeom([2, t], [t+1], x))(abs(k)+1):
    T:= (n, k)-> n! * coeff(series(egf(k), x, n+1), x, n):
    seq(seq(T(n, k), k=1-n..n-1), n=1..8);
    # third Maple program:
    T:= (n, k)-> (t-> `if`(t
    				
  • Mathematica
    T[n_, k_] := With[{t = Abs[k]}, If[tJean-François Alcover, Mar 25 2021, after 3rd Maple program *)

Formula

T(n,k) = T(n,-k).
T(n,k) = (n-t)*(n-1)! if t < n with t = |k|, T(n,k) = 0 otherwise.
T(n,k) = |k|! * A324224(n,k).
E.g.f. of column k: x^t/t * hypergeom([2, t], [t+1], x) with t = |k|+1.
|T(n,k)-T(n,k-1)| = (n-1)! for k = 1-n..n.
Sum_{k=0..n-1} T(n,k) = A001710(n+1).
Showing 1-5 of 5 results.