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.

A086852 Number of permutations of length n with exactly 1 rising or falling succession.

Original entry on oeis.org

0, 0, 2, 4, 10, 40, 230, 1580, 12434, 110320, 1090270, 11876980, 141373610, 1825321016, 25405388150, 379158271420, 6039817462210, 102278890975360, 1834691141852174, 34752142215026180, 693126840194499290, 14519428780464454600, 318705819455462421670
Offset: 0

Views

Author

N. J. A. Sloane, Aug 19 2003

Keywords

Comments

Permutations of 12...n such that exactly one of the following occur: 12, 23, ..., (n-1)n, 21, 32, ..., n(n-1).
For the number of such permutations without (n-1)n or n(n-1) see A383857(n), for n >= 1. - Wolfdieter Lang, May 22 2025

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.

Crossrefs

Twice A000130. A diagonal of 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(n), t, 1):
    seq(a(n), n=0..30);  # Alois P. Heinz, Dec 21 2012
  • 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[n], t, 1]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)

Formula

Coefficient of t^1 in S[n](t) defined in A002464.
(3-n)*a(n) +(n+1)*(n-3)*a(n-1) -(n^2-4*n+5)*a(n-2) -(n-1)*(n-5)*a(n-3) +(n-1)*(n-2)*a(n-4)=0. - R. J. Mathar, Jun 06 2013
a(n) ~ 2*sqrt(2*Pi)*n!/exp(2) = 0.678470495... * n!. - Vaclav Kotesovec, Aug 10 2013
From Wolfdieter Lang, May 31 2025: (Start)
a(n) = Sum_{i=1..n-1} (-1)^(i-1)*i*(n-i)!*Sum_{j=1..i} 2^j*binomial(i-1, j-1)*binomial(n-i, j), for n >= 0. See the D. P. Robbins link, p. 123, eq. (7), A(n, 1).
a(n+2) = Sum_{k=0..n} 2*R(n, k)*B(n, k), with B(n, k) = A384494(n, k) = (-1)^k*(k+1)*(n+1-k)!, and R(n, k) = A104698(n, k), for n >= 0. This equals (2*MR*MB^t)_{n,n}, with the (infinite) square matrices with vanishing upper diagonals corresponding to R and B, and t indicates transposition. (End)

A104698 Triangle read by rows: T(n,k) = Sum_{j=0..n-k} binomial(k, j)*binomial(n-j+1, k+1).

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 9, 6, 1, 5, 16, 19, 8, 1, 6, 25, 44, 33, 10, 1, 7, 36, 85, 96, 51, 12, 1, 8, 49, 146, 225, 180, 73, 14, 1, 9, 64, 231, 456, 501, 304, 99, 16, 1, 10, 81, 344, 833, 1182, 985, 476, 129, 18, 1, 11, 100, 489, 1408, 2471, 2668, 1765, 704, 163, 20, 1, 12
Offset: 0

Views

Author

Gary W. Adamson, Mar 19 2005

Keywords

Comments

The n-th column of the triangle is the binomial transform of the n-th row of A081277, followed by zeros. Example: column 3, (1, 6, 19, 44, ...) = binomial transform of row 3 of A081277: (1, 5, 8, 4, 0, 0, 0, ...). A104698 = reversal by rows of A142978. - Gary W. Adamson, Jul 17 2008
This sequence is jointly generated with A210222 as an array of coefficients of polynomials u(n,x): initially, u(1,x)=v(1,x)=1; for n > 1, u(n,x) = x*u(n-1,x) + v(n-1) + 1 and v(n,x) = 2x*u(n-1,x) + v(n-1,x) + 1. See the Mathematica section at A210222. - Clark Kimberling, Mar 19 2012
This Riordan triangle T appears in a formula for A001100(n, 0) = A002464(n), for n >= 1. - Wolfdieter Lang, May 13 2025

Examples

			The Riordan triangle T begins:
  n\k  0   1   2    3    4    5    6   7   8  9 10 ...
  ----------------------------------------------------
  0:   1
  1:   2   1
  2:   3   4   1
  3:   4   9   6    1
  4:   5  16  19    8    1
  5:   6  25  44   33   10    1
  6:   7  36  85   96   51   12    1
  7:   8  49 146  225  180   73   14   1
  8:   9  64 231  456  501  304   99  16   1
  9:  10  81 344  833 1182  985  476 129  18  1
  10: 11 100 489 1408 2471 2668 1765 704 163 20  1
  ... reformatted and extended by _Wolfdieter Lang_, May 13 2025
From _Wolfdieter Lang_, May 13 2025: (Start)
Zumkeller recurrence (adapted for offset [0,0]): 19 = T(4, 2) = T(2, 1) + T(3, 1) + T(3,3) = 4 + 9 + 6 = 19.
A-sequence recurrence: 19 = T(4, 2) = 1*T(3. 1) + 2*T(3. 2) - 2*T(3, 3) = 9 + 12 - 2 = 19.
Z-sequence recurrence: 5 = T(4, 0) = 2*T(3, 0) - 1*T(3, 1) + 2*T(3, 2) - 6*T(3, 3) = 8 - 9 + 12 + 6 = 5.
Boas-Buck recurrence: 19 = T(4, 2) = (1/2)*((2 + 0)*T(2, 2) + (2 + 2*2)*T(3, 2)) = (1/2)*(2 + 36) = 19. (End)
		

Crossrefs

Diagonal sums are A008937(n+1).
Cf. A048739 (row sums), A008288, A005900 (column 3), A014820 (column 4)
Cf. A081277, A142978 by antidiagonals, A119328, A110271 (matrix inverse).

Programs

  • Haskell
    a104698 n k = a104698_tabl !! (n-1) !! (k-1)
    a104698_row n = a104698_tabl !! (n-1)
    a104698_tabl = [1] : [2,1] : f [1] [2,1] where
       f us vs = ws : f vs ws where
         ws = zipWith (+) ([0] ++ us ++ [0]) $
              zipWith (+) ([1] ++ vs) (vs ++ [0])
    -- Reinhard Zumkeller, Jul 17 2015
  • Maple
    A104698 := proc(n, k) add(binomial(k, j)*binomial(n-j+1, n-k-j), j=0..n-k) ; end proc:
    seq(seq(A104698(n, k), k=0..n), n=0..15); # R. J. Mathar, Sep 04 2011
    T := (n, k) -> binomial(n + 1, k + 1)*hypergeom([-k, k - n], [-n - 1], -1):
    for n from 0 to 9 do seq(simplify(T(n, k)), k = 0..n) od;
    T := proc(n, k) option remember; if k = 0 then n + 1 elif k = n then 1 else T(n-2, k-1) + T(n-1, k-1) + T(n-1, k) fi end: # Peter Luschny, May 13 2025
  • Mathematica
    u[1, ] = 1; v[1, ] = 1;
    u[n_, x_] := u[n, x] = x u[n-1, x] + v[n-1, x] + 1;
    v[n_, x_] := v[n, x] = 2 x u[n-1, x] + v[n-1, x] + 1;
    Table[CoefficientList[u[n, x], x], {n, 1, 11}] // Flatten (* Jean-François Alcover, Mar 10 2019, after Clark Kimberling *)
  • PARI
    T(n,k)=sum(j=0,n-k,binomial(k,j)*binomial(n-j+1,k+1)) \\ Charles R Greathouse IV, Jan 16 2012
    

Formula

The triangle is extracted from the product A * B; A = [1; 1, 1; 1, 1, 1; ...], B = [1; 1, 1; 1, 3, 1; 1, 5, 5, 1; ...] both infinite lower triangular matrices (rest of the terms are zeros). The triangle of matrix B by rows = A008288, Delannoy numbers.
From Paul Barry, Jul 18 2005: (Start)
Riordan array (1/(1-x)^2, x(1+x)/(1-x)) = (1/(1-x), x)*(1/(1-x), x(1+x)/(1-x)).
T(n, k) = Sum_{j=0..n} Sum_{i=0..j-k} C(j-k, i)*C(k, i)*2^i.
T(n, k) = Sum_{j=0..k} Sum_{i=0..n-k-j} (n-k-j-i+1)*C(k, j)*C(k+i-1, i). (End)
T(n, k) = binomial(n+1, k+1)*2F1([-k, k-n], [-n-1], -1) where 2F1 is a Gaussian hypergeometric function. - R. J. Mathar, Sep 04 2011
T(n, k) = T(n-2, k-1) + T(n-1, k-1) + T(n-1, k) for 1 < k < n; T(n, 0) = n + 1; T(n, n) = 1. - Reinhard Zumkeller, Jul 17 2015
From Wolfdieter Lang, May 13 2025: (Start)
The Riordan triangle T = (1/(1 - x)^2, x*(1 + x)/(1 - x)) has the o.g.f. G(x, y) = 1/((1 - x)*(1 - x - y*x*(1+x))) for the row polynomials R(n, y) = Sum_{k=0..n} T(n, k)*y^k.
The o.g.f. for column k is G(k, x) = (1/(1 - x)^2)*(x*(1 + x)/(1 - x))^k, for k >= 0.
The o.g.f. for the diagonal m is D(m, x) = N(m, x)/(1 - x)^(m+1), with the numerator polynomial N(m, x) = Sum_{k=0..floor(m/2)} A034867(m, k)*x^(2*k) for m >= 0.
The row sums with o.g.f. R(x) = 1/((1 -x)*(1 - 2*x -x^2) give A048739.
The alternating row sums with o.g.f. 1/((1 - x)(1 + x^2)) give A133872.
The A-sequence for this Riordan triangle has o.g.f. A(x) = 1 + x + sqrt(1 + 6*x + x^2))/2 giving A112478(n). Hence T(n, k) = Sum_{j=0..n-k} A112478(j)*T(n-1, k-1+j), for n >= 1, k >= 1, T(n, k) = 0 for n < k, and T(0, 0) = 1.
The Z-sequence has o.g.f. (5 + x - sqrt(1 + 6*x + x^2))/2 = 3 + x - A(x) giving Z(n) = {2, -1, -A112478(n >= 2)}. Hence T(n, 0) = Sum_{j=0..n-1} Z(j)*T(n-1, j), for n >= 1. For A- and Z-sequences of Riordan triangles see a W. Lang link at A006232 with references.
The Boas-Buck sequences alpha and beta for the Riordan triangle T (see A046521 for the Aug 10 2017 comment and reference) are alpha(n) = A040000(n+1) = repeat{2} and beta(n) = A010673(n+1) = repeat{2,0}. Hence the recurrence for column T(n, k){n>=k}, with input T(k, k) = 1, for k >= 0, is T(n, k) = (1/(n-k)) * Sum{j=k..n-1} (2 + k*(1 + (-1)^(n-1-j))) *T(j,k), for n >= k+1. (End)

A384186 Number of permutations of 1, 2,..., n with exactly one rising or falling successon, namely (n-1)n or n(n-1).

Original entry on oeis.org

0, 2, 2, 2, 6, 34, 214, 1506, 11990, 107234, 1065846, 11659426, 139217494, 1801784610, 25124797046, 375531165794, 5989287277014, 101524201538146, 1822662037112950, 34548339122512674, 689469487015534166, 14450128299126915746
Offset: 1

Views

Author

Wolfdieter Lang, May 21 2025

Keywords

Comments

For the number of permutations of length n with exactly one rising or falling successon see A086852. For the number of such permutations without either (n-1)n or n(n-1) see A383857, for n >= 1.

Examples

			a(2) = 2*1 from 12 and the reverted 21.
a(3) = 2*1 from 132 and 231.
a(4) = 2*1 from 1342 and 2431.
a(5) = 2*3 from 24513, 24531, 31452 and 31542, 13542, 25413.
		

Crossrefs

Formula

a(n) = A086652(n) - A383857(n), for n >= 1.
a(n) = a(n-2) + 2*(n-2)*A002464(n-2) + 2*A383857(n-2), for n >= 3, with a(1) = 0 and a(2) = 2. One could also use this recurrence for n >= 2, using a(0) = -2 and a(1) = 0.
a(n) = a(n-2) + 2*(b(n-1) + b(n-2)), with b = A002464, for n >= 3, with a(1) = 0 and a(2) = 2.
Showing 1-3 of 3 results.