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.

A001100 Triangle read by rows: T(n,k) = number of permutations of length n with exactly k rising or falling successions, for n >= 1, 0 <= k <= n-1.

Original entry on oeis.org

1, 0, 2, 0, 4, 2, 2, 10, 10, 2, 14, 40, 48, 16, 2, 90, 230, 256, 120, 22, 2, 646, 1580, 1670, 888, 226, 28, 2, 5242, 12434, 12846, 7198, 2198, 366, 34, 2, 47622, 110320, 112820, 64968, 22120, 4448, 540, 40, 2, 479306, 1090270, 1108612, 650644, 236968, 54304, 7900, 748, 46, 2
Offset: 1

Views

Author

N. J. A. Sloane, Aug 19 2003

Keywords

Comments

Number of permutations of 12...n such that exactly k of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).

Examples

			Triangle T(n,k) begins (n >= 1, k = 0..n-1):
    1;
    0,    2;
    0,    4,    2;
    2,   10,   10,   2;
   14,   40,   48,  16,   2;
   90,  230,  256, 120,  22,  2;
  646, 1580, 1670, 888, 226, 28, 2;
  ...
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • J. Riordan, A recurrence for permutations without rising or falling successions. Ann. Math. Statist. 36 (1965), 708-710.
  • David Sankoff and Lani Haque, Power Boosts for Cluster Tests, in Comparative Genomics, Lecture Notes in Computer Science, Volume 3678/2005, Springer-Verlag.

Crossrefs

Triangle in A086856 multiplied by 2. Cf. A010028.

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:
    T:= (n, k)-> coeff(S(n), t, k):
    seq(seq(T(n, k), k=0..n-1), n=1..10);  # Alois P. Heinz, Jan 11 2013
  • 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]]]; t[n_, k_] := Ceiling[Coefficient[s[n], t, k]]; Flatten[ Table[ Table[t[n, k], {k, 0, n - 1}], {n, 1, 10}]] (* Jean-François Alcover, Jan 25 2013, translated from Alois P. Heinz's Maple program *)

Formula

Let T{n, k} = number of permutations of 12...n with exactly k rising or falling successions. Let S[n](t) = Sum_{k >= 0} T{n, k}*t^k. Then S[0] = 1; S[1] = 1; S[2] = 2*t; S[3] = 4*t+2*t^2; for n >= 4, S[n] = (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].
T(n, 0) = n! + Sum_{i=1..m-1} (-1)^i*(n-i)!*Sum_{j=1..i} 2^j*binomial(i-1, j-1)*binomial(n-i, j), and T(n, k) = Sum_{i=1..m-1} (-1)^(i-k)*binomial(i, k)*(n-i)!*Sum_{j=1..i} 2^j*binomial(i-1, j-1)*binomial(n-i, j), for k >= 1, and n >= 1. See the D. P.Robbins link for A(n, k) = T(n, k), and his comment concerning the case k = i = 0 . - Wolfdieter Lang, May 17 2025

A322295 Number of permutations of [2n] with exactly n rising or falling successions.

Original entry on oeis.org

1, 2, 10, 120, 2198, 54304, 1674468, 61736880, 2644978110, 129019925424, 7056278570108, 427516982398576, 28417031969575260, 2055803302988520320, 160786792285272198088, 13517797622576903566560, 1215656330296317906395790, 116440107306323155369822800
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2018

Keywords

Crossrefs

Bisection (even 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), t, n):
    seq(a(n), n=0..20);
  • Mathematica
    s[n_] := s[n] = If[n < 4, {1, 1, 2t, 4t + 2 t^2}[[n+1]], Expand[(n+1-t)* s[n-1] - (1-t)(n-2 + 3t) s[n-2] - (1-t)^2 (n-5+t) s[n-3] + (1-t)^3 (n-3)* s[n-4]]];
    a[n_] := Coefficient[s[2n], t, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Oct 23 2021, after Alois P. Heinz *)

Formula

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

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