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

A259784 Number T(n,k) of permutations p of [n] with no fixed points where the maximal displacement of an element equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 3, 5, 0, 0, 0, 6, 18, 20, 0, 0, 1, 12, 44, 111, 97, 0, 0, 0, 24, 116, 396, 744, 574, 0, 0, 1, 44, 331, 1285, 3628, 5571, 3973, 0, 0, 0, 84, 932, 4312, 15038, 34948, 46662, 31520, 0, 0, 1, 159, 2532, 15437, 59963, 181193, 359724, 434127, 281825, 0
Offset: 0

Views

Author

Alois P. Heinz, Jul 05 2015

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  0, 0;
  0, 1,  0;
  0, 0,  2,   0;
  0, 1,  3,   5,    0;
  0, 0,  6,  18,   20,    0;
  0, 1, 12,  44,  111,   97,    0;
  0, 0, 24, 116,  396,  744,  574,    0;
  0, 1, 44, 331, 1285, 3628, 5571, 3973, 0;
		

Crossrefs

Rows sums give A000166.
Column k=0 and main diagonal give A000007.
Columns k=1-10 give: A059841 (for n>0), A321048, A321049, A321050, A321051, A321052, A321053, A321054, A321055, A321056.
First lower diagonal gives A259834.
T(2n,n) gives A259785.
Cf. A259776.

Programs

  • Maple
    b:= proc(n, s, k) option remember; `if`(n=0, 1, `if`(n+k in s,
          b(n-1, (s minus {n+k}) union `if`(n-k>1, {n-k-1}, {}), k),
          add(`if`(j=n, 0, b(n-1, (s minus {j}) union
          `if`(n-k>1, {n-k-1}, {}), k)), j=s)))
        end:
    A:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), b(n, {$max(1, n-k)..n}, k)):
    T:= (n, k)-> A(n, k) -`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    b[n_, s_, k_] := b[n, s, k] = If[n==0, 1, If[MemberQ[s, n+k], b[n-1, (s ~Complement~ {n+k}) ~Union~ If[n-k>1, {n-k-1}, {}], k], Sum[If[j==n, 0, b[n-1, (s ~Complement~ {j}) ~Union~ If[n-k>1, {n-k-1}, {}], k]], {j, s}]] ];
    A[n_, k_] := If[k == 0, If[n == 0, 1, 0], b[n, Range[Max[1, n-k], n], k]];
    T[n_, k_] :=  A[n, k] - If[k == 0, 0, A[n, k-1]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 05 2019, after Alois P. Heinz *)

Formula

T(n,k) = A259776(n,k) - A259776(n,k-1) for k>0, T(n,0) = A000007(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

Views

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.
		

Crossrefs

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.

A292897 a(n) = -Sum_{k=1..3}(-1)^(n-k)*hypergeom([k, k-n-3], [], 1).

Original entry on oeis.org

3, 7, 27, 129, 755, 5187, 40923, 364333, 3611811, 39448095, 470573723, 6086754297, 84847445907, 1267953887899, 20220829211355, 342759892460517, 6153802869270083, 116652857267320503, 2328215691932062491, 48800672765792988145, 1071780020853500289843
Offset: 0

Views

Author

Peter Luschny, Oct 05 2017

Keywords

Crossrefs

Cf. A000166 (m=1), A259834 (m=2), this sequence (m=3), A292898 (m>=1).

Programs

  • Maple
    A292897 := n -> -add((-1)^(n-k)*hypergeom([k, k-n-3], [], 1), k=1..3):
    seq(simplify(A292897(n)), n=0..20);
  • Mathematica
    Table[-Sum[(-1)^(n-k)*HypergeometricPFQ[{k, k-n-3}, {}, 1], {k,1,3}], {n,0,20}] (* Vaclav Kotesovec, Jul 05 2018 *)

Formula

a(n) = A292898(3, n).
From Vaclav Kotesovec, Jul 05 2018: (Start)
Recurrence: (5*n^2 - 6*n + 4)*a(n) = (5*n^3 - n^2 - 6*n + 9)*a(n-1) + (n-1)*(5*n^2 + 4*n + 3)*a(n-2).
a(n) ~ 5*sqrt(Pi/2) * n^(n + 5/2) / exp(n+1). (End)

A292898 Array read by ascending antidiagonals, A(m, n) = Sum_{k=1..m}(-1)^(k-n-m)* hypergeom([k, k-n-m], [], 1) for m>=1 and n>=0.

Original entry on oeis.org

1, 1, 0, 3, 2, 1, 8, 7, 5, 2, 31, 30, 27, 20, 9, 147, 146, 142, 129, 97, 44, 853, 852, 847, 826, 755, 574, 265, 5824, 5823, 5817, 5786, 5652, 5187, 3973, 1854, 45741, 45740, 45733, 45690, 45463, 44462, 40923, 31520, 14833
Offset: 0

Views

Author

Peter Luschny, Oct 05 2017

Keywords

Examples

			Array starts:
[m\n]   0       1      2       3        4         5          6
-------------------------------------------------------------------
[1]     1,      0,     1,      2,       9,       44,       265, ...  [A000166]
[2]     1,      2,     5,     20,      97,      574,      3973, ...  [A259834(n+2)]
[3]     3,      7,    27,    129,     755,     5187,     40923, ...  [A292897]
[4]     8,     30,   142,    826,    5652,    44462,    394970, ...
[5]    31,    146,   847,   5786,   45463,   403514,   3990679, ...
[6]   147,    852,  5817,  45690,  405423,  4008768,  43692933, ...
[7]   853,   5823, 45733, 405779, 4012101, 43727687, 520723477, ...
  A003470,A193464,A293295.
Displayed as a triangle:
[1]     1;
[2]     1,      0;
[3]     3,      2,     1;
[4]     8,      7,     5,    2;
[5]    31,     30,    27,   20,    9;
[6]   147,    146,   142,  129,   97,   44;
[7]   853,    852,   847,  826,  755,  574,  265;
[8]  5824,   5823,  5817, 5786, 5652, 5187, 3973, 1854;
  A003470,A193464,A293295.
This triangle has row sums A193463.
		

Crossrefs

Programs

  • Maple
    A := (m, n) -> add((-1)^(k-n-m)*hypergeom([k, k-n-m], [], 1), k=1..m):
    seq(lprint(seq(simplify(A(m, n)), n=0..6)), m=1..7);
  • Mathematica
    A[m_, n_] :=  Sum[(-1)^(k-n-m) HypergeometricPFQ[{k, k-n-m},{}, 1], {k, 1, m} ];
    Table[Table[A[m, n], {n,0,6}], {m,1,7}]
Showing 1-4 of 4 results.