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.

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.