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.
%I A007999 #33 Feb 11 2020 10:51:54 %S A007999 1,1,1,1,2,3,8,19,64,213,880,3717,18288,92935,531440,3147495,20525168, %T A007999 138638825,1015694832,7700244745,62623847536,526317901451, %U A007999 4705365925872,43407723925499,423149546210416,4250149857500861,44868038386273776,487341646372204813 %N A007999 a(n) is the number of permutations w of 1,2,...,n such that both w and w^{-1} are alternating. %H A007999 H. O. Foulkes, <a href="https://doi.org/10.1016/0012-365X(76)90045-5">Tangent and secant numbers and representations of symmetric groups</a>, Discrete Math. 15 (1976), no. 4, 311-324. %H A007999 R. P. Stanley, <a href="http://arxiv.org/abs/math/0603520">Alternating permutations and symmetric functions</a>, arXiv:math/0603520 [math.CO], 2006. [_Joel B. Lewis_, May 21 2009] %F A007999 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 %e A007999 The only alternating permutation of 1,2,3 whose inverse is alternating is 132. %e A007999 The two alternating permutations of 1,2,3,4 whose inverses are alternating are 1324 and 3412. %t A007999 m = 27; %t A007999 e[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n+1)(2^(n+1)-1)*BernoulliB[ n+1])/(n+1)]]; %t A007999 u[x_] := Log[(1+x)/(1-x)]/2; %t A007999 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 *) %Y A007999 Cf. A000111. %Y A007999 For odd n, a(n) = A332344(n). %Y A007999 For even n > 1, a(n) - a(n-2) = A332344(n). %Y A007999 For n > 1, a(n) = A332345(n)/2 - A332344(n). %K A007999 nonn %O A007999 0,5 %A A007999 poirier(AT)lacim.uqam.ca, _Simon Plouffe_ %E A007999 More terms from _Vladeta Jovovic_, May 15 2007 %E A007999 Two initial terms (thus correcting first term index, and consequent correction of Mathematica code) added by _David Bevan_, Feb 10 2020