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.

Previous Showing 11-13 of 13 results.

A346462 Triangle read by rows: T(n,k) gives the number of permutations of length n containing exactly k instances of the 1-box pattern; 0 <= k <= n.

Original entry on oeis.org

1, 1, 0, 0, 0, 2, 0, 0, 4, 2, 2, 0, 10, 4, 8, 14, 0, 40, 10, 42, 14, 90, 0, 230, 40, 226, 80, 54, 646, 0, 1580, 230, 1480, 442, 534, 128, 5242, 0, 12434, 1580, 11496, 2920, 4746, 1404, 498, 47622, 0, 110320, 12434, 101966, 22762, 45216, 13138, 7996, 1426
Offset: 0

Views

Author

Peter Kagey, Jul 19 2021

Keywords

Comments

An instance of the 1-box pattern in a permutation pi is a letter pi_i such that pi_{i-1} or pi_{i+1} differs from pi_i by exactly 1.
Column k=0 is A002464. Columns k=2 and k=3 are given by A086852.
Main diagonal begins: 1,0,2,2,8,14,54,128,498,1426,5736,... A363181.

Examples

			The permutation 14327568 has 5 instances of the 1-box pattern:
- position 2 differs from position 3 by one,
- position 3 differs from positions 2 and 4 by one,
- position 4 differs from position 3 by one,
- position 6 differs from position 7 by one,
- position 7 differs from position 6 by one, and
positions 1, 5, and 8 differ from all of their neighbors by more than 1.
Table begins:
  n\k|  0  1    2   3    4   5   6
-----+-----------------------------
   0 |  1
   1 |  1  0
   2 |  0  0    2
   3 |  0  0    4   2
   4 |  2  0   10   4    8
   5 | 14  0   40  10   42  14
   6 | 90  0  230  40  226  80  54
		

Crossrefs

Row sums give A000142.

A384494 Triangle read by rows: T(n, k) = (-1)^k*(k+1)*(n+1-k)!, n >= 0, k = 0..n.

Original entry on oeis.org

1, 2, -2, 6, -4, 3, 24, -12, 6, -4, 120, -48, 18, -8, 5, 720, -240, 72, -24, 10, -6, 5040, -1440, 360, -96, 30, -12, 7, 40320, -10080, 2160, -480, 120, -36, 14, -8, 362880, -80640, 15120, -2880, 600, -144, 42, -16, 9, 3628800, -725760, 120960, -20160, 3600, -720, 168, -48, 18, -10
Offset: 0

Views

Author

Wolfdieter Lang, May 31 2025

Keywords

Comments

This triangle, written as (infinite) square matrix MT with vanishing upper diagonals 0, together with the Riordan triangle A104698, written also as such a square matrix MR, appears in the double sum formula for the number of certain restricted permutations given in A086852(n), as diagonal sequence A086852(n+2) = (2*MR*MT^t)_{n,n}, for n >=0, where t indicates matrix transpositon.

Examples

			The triangle T begins:
  n\k        0        1       2       3     4     5   6   7  8    9 ...
  ---------------------------------------------------------------------
  0:         1
  1:         2       -2
  2:         6       -4       3
  3:        24      -12       6      -4
  4:       120      -48      18      -8     5
  5:       720     -240      72     -24    10    -6
  6:      5040    -1440     360     -96    30   -12   7
  7:     40320   -10080    2160    -480    12   -36  14  -8
  8:    362880   -80640   15120   -2880   600  -144  42 -16  9
  9:   3628800  -725760  120960  -20160  3600  -720 168 -48 18 -10
  ...
		

Crossrefs

Column sequences: A000142(n+1), -A052849, A052560(n-1), -A052578(n-2), A052648(n-3), -A298881(n-4), A062098(n-5), -A159038(n-6), ...

Programs

  • Mathematica
    Table[(-1)^k * (k+1) * (n+1-k)!, {n, 0, 9}, {k, 0, n}] // Flatten (* Amiram Eldar, May 31 2025 *)

Formula

T(n, k) = (-1)^k*(k+1)*(n+1-k)!, for n >= 0 and k = 0, 1, ..., n.
O.g.f. of row polynomials P(n, y) := Sum_{k=0..n} T(n, k) y^k: G(x, y) = ((N(x) - 1)/x) * (1/(1 + y*x)^2), with N(x) = hypergeometric([1,1], [], x), the o.g.f. of {n!}_{n>=0} (see A000142).

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.
Previous Showing 11-13 of 13 results.