# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a343535
Showing 1-1 of 1
%I A343535 #25 Apr 26 2021 08:53:52
%S A343535 1,1,2,5,1,20,4,102,18,626,92,2,4458,564,18,36144,4032,144,328794,
%T A343535 32898,1182,6,3316944,301248,10512,96,36755520,3057840,102240,1200,
%U A343535 443828184,34073184,1085904,14304,24,5800823880,413484240,12538080,174000,600,81591320880
%N A343535 Number T(n,k) of permutations of [n] having exactly k consecutive triples j, j+1, j-1; triangle T(n,k), n>=0, 0<=k<=floor(n/3), read by rows.
%C A343535 Terms in column k are multiples of k!.
%H A343535 Anders Claesson, From Hertzsprung's problem to pattern-rewriting systems, University of Iceland (2020).
%H A343535 Wikipedia, Permutation
%F A343535 T(3n,n) = n!.
%e A343535 T(4,1) = 4: 1342, 2314, 3421, 4231.
%e A343535 Triangle T(n,k) begins:
%e A343535 1;
%e A343535 1;
%e A343535 2;
%e A343535 5, 1;
%e A343535 20, 4;
%e A343535 102, 18;
%e A343535 626, 92, 2;
%e A343535 4458, 564, 18;
%e A343535 36144, 4032, 144;
%e A343535 328794, 32898, 1182, 6;
%e A343535 3316944, 301248, 10512, 96;
%e A343535 36755520, 3057840, 102240, 1200;
%e A343535 443828184, 34073184, 1085904, 14304, 24;
%e A343535 5800823880, 413484240, 12538080, 174000, 600;
%e A343535 81591320880, 5428157760, 156587040, 2214720, 10800;
%e A343535 1228888215960, 76651163160, 2105035440, 29777520, 175800, 120;
%e A343535 ...
%p A343535 b:= proc(s, l, t) option remember; `if`(s={}, 1, add((h->
%p A343535 expand(b(s minus {j}, j, `if`(h=1, 2, 1))*
%p A343535 `if`(t=2 and h=-2, x, 1)))(j-l), j=s))
%p A343535 end:
%p A343535 T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
%p A343535 b({$1..n}, -1, 1)):
%p A343535 seq(T(n), n=0..13);
%t A343535 b[s_, l_, t_] := b[s, l, t] = If[s == {}, 1, Sum[Function[h,
%t A343535 Expand[b[s ~Complement~ {j}, j, If[h == 1, 2, 1]]*
%t A343535 If[t == 2 && h == -2, x, 1]]][j - l], {j, s}]];
%t A343535 T[n_] := CoefficientList[b[Range[n], -1, 1], x];
%t A343535 T /@ Range[0, 13] // Flatten (* _Jean-François Alcover_, Apr 26 2021, after _Alois P. Heinz_ *)
%Y A343535 Column k=0 gives A212580.
%Y A343535 Row sums give A000142.
%Y A343535 Cf. A047921, A123513, A197365, A216716.
%K A343535 nonn,tabf
%O A343535 0,3
%A A343535 _Alois P. Heinz_, Apr 18 2021
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE