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

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

Views

Author

Alois P. Heinz, Dec 01 2017

Keywords

Examples

			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;
		

Crossrefs

Column k=0 gives A295974.
Last elements of rows for n>3 give: A001250, A260786, 2*A000111.
Row sums give A000142.

Programs

  • Maple
    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);
  • Mathematica
    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

Views

Author

Keywords

Examples

			2*x/(1+e^(2*x)) = 0 + x - 2/2!*x^2 + 8/4!*x^4 - 96/6!*x^6 + 2176/8!*x^8 ...
		

Crossrefs

Programs

  • Maple
    a := n -> 4^n*n*`if`(n=0,0,abs(euler(2*n-1, 0))): # Peter Luschny, Jun 09 2016
  • Mathematica
    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 *)
  • PARI
    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

Formula

a(n) = n 4^n |E_{2n-1}(1/2)+E_{2n-1}(1)| for n > 0; E_{n}(x) Euler polynomials. - Peter Luschny, Nov 25 2010
a(n) = (2*n)! * [x^(2*n)] tan(x)*x.
a(n) = 2*(2*n)!*Pi^(-2*n)*(4^n-1)*Li{2*n}(1) for n > 0. - Peter Luschny, Jun 29 2012
E.g.f.: sqrt(x)*tan(sqrt(x))= sum(n>=0, a(n)*x^n/(2*n)! ) = x/T(0) where T(k)= 1 - 4*k^2 + x*(1 - 4*k^2)/T(k+1) ; (continued fraction, 1-step). - Sergei N. Gladkovskii, Sep 19 2012
E.g.f.: -1 - x^(1/2)- Q(0),where Q(k) = 4*k -1 - x/( 1 - x/ (4*k+1 + x/( 1 + x/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Nov 24 2013
From Peter Luschny, Jun 09 2016: (Start)
a(n) = (4^n-16^n)*Sum_{k=0..2*n} (-1)^(n-k)*Stirling2(2*n, k)*k!/(k+1).
2*a(n)/4^n = A110501(n) for n>=1.
a(n) / 2^n = A117513(n) for n>=1. (End)
a(n) ~ (4*(4^(2*n)-2^(2*n)))*Pi*(n/(Pi*e))^(2*n+1/2)*exp(1/2+1/(24*n)-1/(2880*n^3) +1/(40320*n^5)-...). - Peter Luschny, Jan 16 2017
a(n) = (-1)^n*4*n*PolyLog(1 - 2*n, -i). - Peter Luschny, Aug 17 2021
a(n) = 2*A024255(n). - Alois P. Heinz, Aug 17 2021

Extensions

Extended and signs tested by Olivier Gérard, Mar 15 1997

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

Views

Author

Alois P. Heinz, Dec 02 2013

Keywords

Examples

			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.
		

Crossrefs

Column k=0 of A232933.

Programs

  • Maple
    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);
  • Mathematica
    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 *)

Formula

a(n) ~ d^n * n!, where d = A245758 = 0.782704180171521701844707497734609... . - Vaclav Kotesovec, Aug 22 2014
Showing 1-3 of 3 results.