%I #104 Dec 09 2021 00:58:07
%S 1,1,2,8,40,256,1952,17408,177280,2031616,25866752,362283008,
%T 5535262720,91620376576,1633165156352,31191159799808,635421069967360,
%U 13753735117275136,315212388819402752,7625476699018231808
%N E.g.f. cos(x)/(cos(x) - sin(x)).
%C For a refinement of these numbers see A185896.
%C A signed permutation is a sequence (x_1,x_2,...,x_n) of integers such that {|x_1|,|x_2|,...|x_n|} = {1,2...,n}. Let x_1,...,x_n be a signed permutation. Then we say 0,x_1,...,x_n,0 is a snake of type S(n;0,0) when 0 < x_1 > x_2 < ... 0. For example, 0 4 -3 -1 -2 0 is a snake of type S(4;0,0). Then a(n) equals the cardinality of S(n;0,0) [Verges]. An example is given below. - _Peter Bala_, Sep 02 2011
%C Original name was: E.g.f. cos(x)*(cos(x)+sin(x)) /cos(2*x). - _Arkadiusz Wesolowski_, Jul 25 2012
%C Number of plane (that is, ordered) increasing 0-1-2 trees on n vertices where the vertices of outdegree 1 or 2 come in two colors. An example is given below. - _Peter Bala_, Oct 10 2012
%H R. J. Mathar, <a href="/A000828/b000828.txt">Table of n, a(n) for n = 0..200</a>
%H Paul Barry, <a href="https://arxiv.org/abs/2107.14278">Series reversion with Jacobi and Thron continued fractions</a>, arXiv:2107.14278 [math.NT], 2021.
%H F. Bergeron, Ph. Flajolet and B. Salvy, <a href="http://algo.inria.fr/flajolet/Publications/BeFlSa92.pdf">Varieties of Increasing Trees</a>, Lecture Notes in Computer Science vol. 581, ed. J.-C. Raoult, Springer 1992, pp. 24-48.
%H D. Dumont, <a href="http://dx.doi.org/10.1006/aama.1995.1014">Further triangles of Seidel-Arnold type and continued fractions related to Euler and Springer numbers</a>, Adv. Appl. Math., 16 (1995), 275-296.
%H Wiktor Ejsmont and Franz Lehner, <a href="https://arxiv.org/abs/2004.02679">The Free Tangent Law</a>, arXiv:2004.02679 [math.OA], 2020.
%H M. Josuat-Verges, <a href="http://arxiv.org/abs/1011.0929">Enumeration of snakes and cycle-alternating permutations</a>, arXiv:1011.0929 [math.CO], 2010.
%H Vladimir Kruchinin, <a href="http://arxiv.org/abs/1009.2565">Composition of ordinary generating functions</a>, arXiv:1009.2565 [math.CO], 2010.
%F E.g.f.: 1/(1- tan(x)). - _Emeric Deutsch_, Sep 10 2001
%F a(n) = A000831(n)/2 for n>0. - _Peter Luschny_, Nov 25 2010
%F a(n) = sum(evenp(n+k), k=1..n, (-1)^((n+k)/2)*sum(j=k..n, j!/n!*stirling2(n,j)*2^(n-j)*(-1)^(n+j-k)*binomial(j-1,k-1)), n>0. - _Vladimir Kruchinin_, Aug 18 2010
%F a(n) = (-1)^((n^2-n)/2)*4^n*(E_{n}(1/2)+E_{n}(1))/2 for n >= 0, where E_{n}(x) is an Euler polynomial. - _Peter Luschny_, Nov 25 2010
%F From _Peter Bala_, Sep 02 2011: (Start)
%F a(n) = (2*i)^(n-1)*Sum_{k = 1..n} (-1)^(n-k)*k!* Stirling2(n,k) * ((1-i)/2)^(k-1), where i = sqrt(-1).
%F a(n) = 2^(n-1)*A000111(n) for n >= 1.
%F Let f(x) = 1+x^2 and define the effect of the operator D on a function g(x) by D(g(x)) = d/dx(f(x)*g(x)). Then for n >= 0, a(n+1) = D^n(1) evaluated at x = 1. (End)
%F From _Sergei N. Gladkovskii_, Dec 09 2011 - Dec 23 2013: (Start) Continued fractions:
%F E.g.f.: 1 + x/(G(0)-x); G(k) = 2*k + 1 - (x^2)/G(k+1).
%F E.g.f.: 1 + x/(U(0)-2*x) where U(k) = 4*k+1 + x/(1+x/(4*k+3 - x/(1- x/U(k+1)))).
%F E.g.f.: 1 + x/(U(0)-x) where U(k) = 2*k+1 - x^2/U(k+1).
%F G.f.: 1 + x/G(0) where G(k) = 1 - x*(2*k+2) - 2*x^2*(k+1)*(k+2)/G(k+1).
%F E.g.f.: 1 + x/T(0) where T(k) = 4*k+1 - x/(1 - x/(4*k+3 + x/(1 + x/T(k+1)))).
%F G.f.: 1 + x/Q(0) where Q(k) = 1 - 2*x*(2*k+1) - 2*x^2*(2*k+1)*(2*k+2)/(1 - 2*x*(2*k+2) - 2*x^2*(2*k+2)*(2*k+3)/Q(k+1)).
%F G.f.: 1 + x/(1-2*x)*T(0) where T(k) = 1 - 2*x^2*(k+1)*(k+2)/( 2*x^2*(k+1)*(k+2) - (1 - 2*x*(k+1))*(1 - 2*x*(k+2))/T(k+1)).
%F E.g.f.: T(0) where T(k) = 1 + x/(4*k+1 - x/(1 - x/( 4*k+3 + x/T(k+1)))). (End)
%F G.f.: 1 /(1 - 1*x /(1 - 1*x /(1 - 4*x /(1 - 2*6*x^2 /(1 - 6*x /(1 - 4*x /(1 - 4*x /(1 - 10*x /(1 - 5*12*x^2 /(1 - 12*x / ...)))))))))). - _Michael Somos_, May 12 2012
%F a(n) ~ n! * 2^(2*n+1)/Pi^(n+1). - _Vaclav Kotesovec_, Jun 21 2013
%F a(0) = a(1) = 1; a(n) = 2 * Sum_{k=1..n-1} binomial(n-1,k) * a(k) * a(n-k-1). - _Ilya Gutkovskiy_, Nov 21 2020
%F From _Peter Bala_, Dec 04 2021: (Start)
%F F(x) = exp(2*x)*(exp(2*x) - 1)/(exp(4*x) + 1) = x + 2*x^2/2! - 8*x^3/3! - 40*x^4/4! + 256*x^5/5! + 1952*x^6/6! - - + + ... is the e.g.f. for the sequence [1, 2, -8, -40, 256, 1952, ...], a signed version of this sequence without the first term.
%F Let G(x) = x + 2*x^2 - 8*x^3 - 40*x^4 + 256*x^5 + 1952*x^6 - - + + ... be the corresponding o.g.f. We have the continued fraction representation G(x) = x/(1 - 2*x + 12*x^2/(1 + 20*x^2/(1 - 2*x + 56*x^2/(1 + 72*x^2/(1 - 2*x + ... + 4*n*(4*n-1)*x^2/(1 + 4*n*(4*n+1)*x^2/(1 - 2*x + ... ))))))).
%F The inverse binomial transform 1/(1 + x)*G(x/(1 + x)) = x - 11*x^3 + 361*x^5 - 24611*x^7 + - ... is a g.f. for a signed and aerated version of A000464. (End)
%e a(3) = 8: The eight snakes of type S(3;0,0) are
%e 0 1 -2 3 0, 0 1 -3 2 0, 0 2 1 3 0, 0 2 -1 3 0, 0 2 -3 1 0,
%e 0 3 1 2 0, 0 3 -1 2 0, 0 3 -2 1 0.
%e 1 + x + 2*x^2 + 8*x^3 + 40*x^4 + 256*x^5 + 1952*x^6 + 17408*x^7 + ...
%e a(3) = 8: The eight increasing 0-1-2 trees on 3 vertices are
%e ..1o (x2 colors)......1o (x2 colors)......1o (x2 colors).....
%e ...|................./.\................./.\.................
%e ..2o (x2 colors)...2o...o3.............3o...o2...............
%e ...|
%e ..3o
%e Totals.......................................................
%e ...4......+...........2.........+.........2....=...8.........
%p A000828 := n -> (-1)^((n-1)*n/2)*4^n*(Euler(n,1/2)+Euler(n,1))/2: # _Peter Luschny_, Nov 25 2010
%t a[n_] := (-1)^((n-1)*n/2)*4^n*(EulerE[n, 1/2] + EulerE[n, 1])/2; Table[a[n], {n, 0, 19}] (* _Jean-François Alcover_, Nov 22 2012, after _Peter Luschny_ *)
%o (Maxima) a(n):=sum(if evenp(n+k) then (-1)^((n+k)/2)*sum(j!/n!*stirling2(n,j)*2^(n-j)*(-1)^(n+j-k)*binomial(j-1,k-1),j,k,n),k,1,n); /* _Vladimir Kruchinin_, Aug 18 2010 */
%o (PARI) my(x='x + O('x^30)); Vec(serlaplace(cos(x)/(cos(x)-sin(x)))) \\ _Michel Marcus_, Nov 21 2020
%Y Cf. A000464, A000825. A000111, A185896, A235131, A235132.
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_
%E Name changed by _Arkadiusz Wesolowski_, Jul 25 2012