A295987
Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step patterns 010 or 101, where 1=up and 0=down; triangle T(n,k), n >= 0, k = max(0, n-3), read by rows.
Original entry on oeis.org
1, 1, 2, 6, 14, 10, 52, 36, 32, 204, 254, 140, 122, 1010, 1368, 1498, 620, 544, 5466, 9704, 9858, 9358, 3164, 2770, 34090, 67908, 90988, 72120, 63786, 18116, 15872, 233026, 545962, 762816, 839678, 560658, 470262, 115356, 101042, 1765836, 4604360, 7458522
Offset: 0
Triangle T(n,k) begins:
: 1;
: 1;
: 2;
: 6;
: 14, 10;
: 52, 36, 32;
: 204, 254, 140, 122;
: 1010, 1368, 1498, 620, 544;
: 5466, 9704, 9858, 9358, 3164, 2770;
: 34090, 67908, 90988, 72120, 63786, 18116, 15872;
: 233026, 545962, 762816, 839678, 560658, 470262, 115356, 101042;
-
b:= proc(u, o, t, h) option remember; expand(
`if`(u+o=0, 1, `if`(t=0, add(b(u-j, j-1, 1$2), j=1..u),
add(`if`(h=3, x, 1)*b(u-j, o+j-1, [1, 3, 1][t], 2), j=1..u)+
add(`if`(t=3, x, 1)*b(u+j-1, o-j, 2, [1, 3, 1][h]), j=1..o))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$3)):
seq(T(n), n=0..12);
-
b[u_, o_, t_, h_] := b[u, o, t, h] = Expand[If[u + o == 0, 1, If[t == 0, Sum[b[u - j, j - 1, 1, 1], {j, 1, u}], Sum[If[h == 3, x, 1]*b[u - j, o + j - 1, {1, 3, 1}[[t]], 2], {j, 1, u}] + Sum[If[t == 3, x, 1]*b[u + j - 1, o - j, 2, {1, 3, 1}[[h]]], {j, 1, o}]]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, 0, 0, 0]];
Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jun 07 2018, from Maple *)
A009752
Expansion of e.g.f. tan(x)*x (even powers only).
Original entry on oeis.org
0, 2, 8, 96, 2176, 79360, 4245504, 313155584, 30460116992, 3777576173568, 581777702256640, 108932957168730112, 24370173276164456448, 6419958484945407574016, 1967044844910430876860416, 693575525634287935244206080, 278846808228005417477465964544, 126799861926498005417315327279104
Offset: 0
2*x/(1+e^(2*x)) = 0 + x - 2/2!*x^2 + 8/4!*x^4 - 96/6!*x^6 + 2176/8!*x^8 ...
-
a := n -> 4^n*n*`if`(n=0,0,abs(euler(2*n-1, 0))): # Peter Luschny, Jun 09 2016
-
nn = 30; t = Range[0, nn]! CoefficientList[Series[x*Tan[x], {x, 0, nn}], x]; Take[t, {1, nn + 1, 2}] (* T. D. Noe, Sep 20 2012 *)
Table[(-1)^n 4 n PolyLog[1 - 2 n, -I], {n, 0, 19}] (* Peter Luschny, Aug 17 2021 *)
-
my(x='x+O('x^50)); v=Vec(serlaplace(x*tan(x))); concat([0], vector(#v\2,n,v[2*n-1])) \\ G. C. Greubel, Feb 12 2018
A232899
Number of permutations of [n] cyclically avoiding the consecutive step pattern UDU (U=up, D=down).
Original entry on oeis.org
1, 1, 0, 3, 12, 35, 144, 910, 5976, 39942, 306570, 2698223, 25536132, 257563618, 2813856192, 33154390275, 415692891552, 5523237345701, 77778820305558, 1157352664763569, 18120617730892800, 297774609082108662, 5127157782095091402, 92308888110570124310
Offset: 0
a(2) = 0 because 12 and 21 do not avoid UDU (the two U's overlap).
a(3) = 3: 132, 213, 321.
a(4) = 12: 1243, 1342, 1432, 2134, 2143, 2431, 3124, 3214, 3421, 4213, 4312, 4321.
a(5) = 35: 12354, 12453, 12543, ..., 54213, 54312, 54321.
-
b:= proc(u, o, t) option remember; `if`(t=4, 0,
`if`(u+o=0, `if`(t=2, 0, 1),
add(b(u+j-1, o-j, [2, 2, 4][t]), j=1..o)+
add(b(u-j, o+j-1, [1, 3, 1][t]), j=1..u)))
end:
a:= n-> `if`(n<2, 1, n*b(0, n-1, 1)):
seq(a(n), n=0..30);
-
b[u_, o_, t_] := b[u, o, t] = If[t == 4, 0,
If[u + o == 0, If[t == 2, 0, 1],
Sum[b[u + j - 1, o - j, {2, 2, 4}[[t]]], {j, 1, o}] +
Sum[b[u - j, o + j - 1, {1, 3, 1}[[t]]], {j, 1, u}]]];
a[n_] := If[n < 2, 1, n b[0, n - 1, 1]];
a /@ Range[0, 30] (* Jean-François Alcover, Dec 19 2020, after Alois P. Heinz *)
Showing 1-3 of 3 results.