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.

A322296 Number of permutations of [2n+1] with exactly n rising or falling successions.

Original entry on oeis.org

1, 4, 48, 888, 22120, 685368, 25344480, 1087931184, 53138966904, 2909014993080, 176372774697856, 11729862804913680, 848948339328178128, 66420006805308507568, 5585680154203107163200, 502437191145813112268640, 48134705092961286591532440
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2018

Keywords

Crossrefs

Bisection (odd part) of A322294.
Cf. A001100.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> coeff(S(2*n+1), t, n):
    seq(a(n), n=0..20);
  • Mathematica
    S[n_] := S[n] = If[n < 4, {1, 1, 2*t, 4*t + 2*t^2}[[n + 1]], Expand[
                   (n + 1 - t)*S[n - 1] -
         (1 - t)*(n - 2 + 3*t)*S[n - 2] -
         (1 - t)^2*(n - 5 + t)*S[n - 3] +
             (1 - t)^3*(n - 3)*S[n - 4]]];
    a[n_] := Coefficient[S[2*n + 1], t, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Apr 21 2022, after Alois P. Heinz *)

Formula

a(n) = A001100(2n+1,n).