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-2 of 2 results.

A007999 a(n) is the number of permutations w of 1,2,...,n such that both w and w^{-1} are alternating.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 8, 19, 64, 213, 880, 3717, 18288, 92935, 531440, 3147495, 20525168, 138638825, 1015694832, 7700244745, 62623847536, 526317901451, 4705365925872, 43407723925499, 423149546210416, 4250149857500861, 44868038386273776, 487341646372204813
Offset: 0

Views

Author

poirier(AT)lacim.uqam.ca, Simon Plouffe

Keywords

Examples

			The only alternating permutation of 1,2,3 whose inverse is alternating is 132.
The two alternating permutations of 1,2,3,4 whose inverses are alternating are 1324 and 3412.
		

Crossrefs

Cf. A000111.
For odd n, a(n) = A332344(n).
For even n > 1, a(n) - a(n-2) = A332344(n).
For n > 1, a(n) = A332345(n)/2 - A332344(n).

Programs

  • Mathematica
    m = 27;
    e[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n+1)(2^(n+1)-1)*BernoulliB[ n+1])/(n+1)]];
    u[x_] := Log[(1+x)/(1-x)]/2;
    Sum[e[2k+1]^2 u[x]^(2k+1)/(2k+1)!, {k, 0, m}] + (1-x^2)^(-1/2) Sum[e[2k]^2* u[x]^(2k)/(2k)!, {k, 0, m}] + O[x]^m // CoefficientList[#, x]& (* Jean-François Alcover, Feb 24 2019 *)

Formula

G.f.: Sum_{k>=0} E_{2k+1}^2 u^(2k+1)/(2k+1)! + (1-x^2)^(-1/2) Sum_{k>=0} E_{2k}^2 u^(2k)/(2k)!, where E_j is an Euler number (A000111) and u = (1/2)*log((1+x)/(1-x)). - Richard Stanley, Jan 21 2006

Extensions

More terms from Vladeta Jovovic, May 15 2007
Two initial terms (thus correcting first term index, and consequent correction of Mathematica code) added by David Bevan, Feb 10 2020

A332345 a(n) is the number of totally alternating permutations of 1,2,...,n.

Original entry on oeis.org

1, 1, 2, 4, 6, 12, 28, 76, 240, 852, 3392, 14868, 71392, 371740, 2089184, 12589980, 81037792, 554555300, 4021728992, 30800978980, 248464000480, 2105271605804, 18696216008416, 173630895701996, 1683187452989920, 17000599430003444, 178625854452674272
Offset: 0

Views

Author

David Bevan, Feb 10 2020

Keywords

Comments

A permutation w of 1,...,n is totally alternating if both w and w^{-1} are either alternating or reverse alternating.
Totally alternating permutations are those that avoid the consecutive patterns 123 and 321 and also the consecutive covincular patterns 123 and 321.
If a permutation is totally alternating, then so are its other 7 symmetries.

Examples

			The six totally alternating permutations of 1,...,4 are 1324, 2143, 2413, 3142, 3412 and 4231.
		

Crossrefs

For n > 1, a(n) = 2*(A007999(n) + A332344(n)).
For odd n > 1, a(n) = 4*A007999(n).
For even n > 1, a(n) = 4*A007999(n) - 2*A007999(n-2).
Showing 1-2 of 2 results.