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.

A323671 Number T(n,k) of permutations p of [n] with no fixed points such that |{ j : |p(j)-j| = 1 }| = k; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

This page as a plain text file.
%I A323671 #24 Feb 09 2021 08:19:34
%S A323671 1,0,0,0,0,1,0,0,2,0,1,2,3,2,1,4,12,14,8,6,0,29,68,82,54,25,6,1,206,
%T A323671 496,546,376,170,48,12,0,1708,3960,4349,2922,1353,430,98,12,1,15702,
%U A323671 35816,38632,26048,12084,4052,982,160,20,0,159737,358786,383523,257552,120919,41508,10647,1998,270,20,1
%N A323671 Number T(n,k) of permutations p of [n] with no fixed points such that |{ j : |p(j)-j| = 1 }| = k; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.
%H A323671 Alois P. Heinz, <a href="/A323671/b323671.txt">Rows n = 0..23, flattened</a>
%F A323671 Sum_{k=1..n} T(n,k) = A296050(n).
%e A323671 T(4,0) = 1: 3412.
%e A323671 T(4,1) = 2: 3421, 4312.
%e A323671 T(4,2) = 3: 2413, 3142, 4321.
%e A323671 T(4,3) = 2: 2341, 4123.
%e A323671 T(4,4) = 1: 2143.
%e A323671 Triangle T(n,k) begins:
%e A323671       1;
%e A323671       0,     0;
%e A323671       0,     0,     1;
%e A323671       0,     0,     2,     0;
%e A323671       1,     2,     3,     2,     1;
%e A323671       4,    12,    14,     8,     6,    0;
%e A323671      29,    68,    82,    54,    25,    6,   1;
%e A323671     206,   496,   546,   376,   170,   48,  12,   0;
%e A323671    1708,  3960,  4349,  2922,  1353,  430,  98,  12,  1;
%e A323671   15702, 35816, 38632, 26048, 12084, 4052, 982, 160, 20, 0;
%e A323671   ...
%p A323671 b:= proc(s) option remember; expand((n-> `if`(n=0, 1, add(
%p A323671       (t-> `if`(t=0, 0, `if`(t=1, x, 1)*b(s minus {j}))
%p A323671        )(abs(n-j)), j=s)))(nops(s)))
%p A323671     end:
%p A323671 T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b({$1..n})):
%p A323671 seq(T(n), n=0..12);
%t A323671 b[s_] := b[s] = Expand[Function[n, If[n==0, 1, Sum[Function[t, If[t==0, 0, If[t==1, x, 1]*b[s~Complement~{j}]]][Abs[n-j]], {j, s}]]][Length[s]]];
%t A323671 T[n_] := PadRight[CoefficientList[b[Range[n]], x], n+1];
%t A323671 T /@ Range[0, 12] // Flatten (* _Jean-François Alcover_, Feb 09 2021, after _Alois P. Heinz_ *)
%Y A323671 Column k=0 gives A001883.
%Y A323671 Row sums give A000166.
%Y A323671 Main diagonal and lower diagonal give A059841, A110660.
%Y A323671 Cf. A296050, A320582.
%K A323671 nonn,tabl
%O A323671 0,9
%A A323671 _Alois P. Heinz_, Jan 23 2019