login
E.g.f.: (3+2*sqrt(3)*exp(x/2)*sin(sqrt(3)*x/2))/(exp(-x)+2*exp(x/2)*cos(sqrt(3)*x/2)).
8

%I #63 Mar 23 2020 17:31:43

%S 1,1,1,1,3,9,19,99,477,1513,11259,74601,315523,3052323,25740261,

%T 136085041,1620265923,16591655817,105261234643,1488257158851,

%U 17929265150637,132705221399353,2172534146099019,30098784753112329,254604707462013571,4736552519729393091,74180579084559895221,705927677520644167681,14708695606607601165843,256937013876000351610089,2716778010767155313771539

%N E.g.f.: (3+2*sqrt(3)*exp(x/2)*sin(sqrt(3)*x/2))/(exp(-x)+2*exp(x/2)*cos(sqrt(3)*x/2)).

%C According to Mendes and Remmel, p. 56, this is the e.g.f. for 3-alternating permutations.

%H Alois P. Heinz, <a href="/A178963/b178963.txt">Table of n, a(n) for n = 0..500</a>

%H J. M. Luck, <a href="http://arxiv.org/abs/1309.7764">On the frequencies of patterns of rises and falls</a>, arXiv preprint arXiv:1309.7764 [cond-mat.stat-mech], 2013-2014.

%H Peter Luschny, <a href="http://oeis.org/wiki/User:Peter_Luschny/SeidelTransform">An old operation on sequences: the Seidel transform</a>.

%H Anthony Mendes and Jeffrey Remmel, Generating functions from symmetric functions, Preliminary version of book, available from <a href="http://math.ucsd.edu/~remmel/">Jeffrey Remmel's home page</a>.

%H Ludwig Seidel, <a href="https://babel.hathitrust.org/cgi/pt?id=hvd.32044092897461&amp;view=1up&amp;seq=176">Über eine einfache Entstehungsweise der Bernoulli'schen Zahlen und einiger verwandten Reihen</a>, Sitzungsberichte der mathematisch-physikalischen Classe der königlich bayerischen Akademie der Wissenschaften zu München, volume 7 (1877), 157-187. [USA access only through the <a href="https://www.hathitrust.org/accessibility">HATHI TRUST Digital Library</a>]

%H Ludwig Seidel, <a href="https://www.zobodat.at/pdf/Sitz-Ber-Akad-Muenchen-math-Kl_1877_0157-0187.pdf">Über eine einfache Entstehungsweise der Bernoulli'schen Zahlen und einiger verwandten Reihen</a>, Sitzungsberichte der mathematisch-physikalischen Classe der königlich bayerischen Akademie der Wissenschaften zu München, volume 7 (1877), 157-187. [Access through <a href="https://de.wikipedia.org/wiki/ZOBODAT">ZOBODAT</a>]

%F a(3*n) = A002115(n). - _Peter Luschny_, Aug 02 2012

%p A178963_list := proc(dim) local E,DIM,n,k;

%p DIM := dim-1; E := array(0..DIM, 0..DIM); E[0,0] := 1;

%p for n from 1 to DIM do

%p if n mod 3 = 0 then E[n,0] := 0 ;

%p for k from n-1 by -1 to 0 do E[k,n-k] := E[k+1,n-k-1] + E[k,n-k-1] od;

%p else E[0,n] := 0;

%p for k from 1 by 1 to n do E[k,n-k] := E[k-1,n-k+1] + E[k-1,n-k] od;

%p fi od; [E[0,0],seq(E[k,0]+E[0,k],k=1..DIM)] end:

%p A178963_list(30); # _Peter Luschny_, Apr 02 2012

%p # Alternatively, using a bivariate exponential generating function:

%p A178963 := proc(n) local g, p, q;

%p g := (x,z) -> 3*exp(x*z)/(exp(z)+2*exp(-z/2)*cos(z*sqrt(3)/2));

%p p := (n,x) -> n!*coeff(series(g(x,z),z,n+2),z,n);

%p q := (n,m) -> if modp(n,m) = 0 then 0 else 1 fi:

%p (-1)^floor(n/3)*p(n,q(n,3)) end:

%p seq(A178963(i),i=0..30); # _Peter Luschny_, Jun 06 2012

%p # third Maple program:

%p b:= proc(u, o, t) option remember; `if`(u+o=0, 1,

%p `if`(t=0, add(b(u-j, o+j-1, irem(t+1, 3)), j=1..u),

%p add(b(u+j-1, o-j, irem(t+1, 3)), j=1..o)))

%p end:

%p a:= n-> b(n, 0, 0):

%p seq(a(n), n=0..35); # _Alois P. Heinz_, Oct 29 2014

%t max = 30; f[x_] := (E^x*(2*Sqrt[3]*E^(x/2)*Sin[(Sqrt[3]*x)/2] + 3))/(2*E^((3*x)/2)*Cos[(Sqrt[3]*x)/2] + 1); CoefficientList[Series[f[x], {x, 0, max}], x]*Range[0, max]! // Simplify (* _Jean-François Alcover_, Sep 16 2013 *)

%o (Sage) # uses[A from A181936]

%o A178963 = lambda n: (-1)^int(is_odd(n//3))*A(3,n)

%o print([A178963(n) for n in (0..30)]) # _Peter Luschny_, Jan 24 2017

%Y Number of m-alternating permutations: A000012 (m=1), A000111 (m=2), A178963 (m=3), A178964 (m=4), A181936 (m=5).

%Y Cf. A181937, A002115.

%Y Cf. A249402, A249583 (alternative definitions of 3-alternating permutations).

%K nonn

%O 0,5

%A _N. J. A. Sloane_, Dec 31 2010