OFFSET
0,6
COMMENTS
According to Mendes and Remmel, p. 56, this is the e.g.f. for 4-alternating permutations.
REFERENCES
Anthony Mendes and Jeffrey Remmel, Generating functions from symmetric functions, Preliminary version of book, available from Jeffrey Remmel's home page http://math.ucsd.edu/~remmel/
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
J. M. Luck, On the frequencies of patterns of rises and falls, arXiv:1309.7764 [cond-mat.stat-mech], 2013-2014.
Peter Luschny, An old operation on sequences: the Seidel transform
FORMULA
a(n) ~ n! * 2^(n/2+1) * (-sqrt(2)*(-1+(-1)^n) - 2*cos(n*Pi/2)*(sinh(Pi/2)-1)/cosh(Pi/2) + (1+(-1)^n)*(1 + sinh(Pi/2))/cosh(Pi/2)) / Pi^(n+1). - Vaclav Kotesovec, Sep 09 2014
MAPLE
A178964_list := proc(dim) local E, DIM, n, k;
DIM := dim-1; E := array(0..DIM, 0..DIM); E[0, 0] := 1;
for n from 1 to DIM do
if n mod 4 = 0 then E[n, 0] := 0 ;
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;
else E[0, n] := 0;
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;
fi od; [E[0, 0], seq(E[k, 0]+E[0, k], k=1..DIM)] end:
A178964_list(31); # Peter Luschny, Apr 02 2012
# Alternatively, using a bivariate exponential generating function:
A178964 := proc(n) local g, p, q;
g := (x, z) -> 2*exp(x*z)/(cosh(z)+cos(z));
p := (n, x) -> n!*coeff(series(g(x, z), z, n+2), z, n);
q := (n, m) -> if modp(n, m) = 0 then 0 else 1 fi:
(-1)^binomial(n, 4)*p(n, q(n, 4)) end:
seq(A178964(i), i=0..30); # Peter Luschny, Jun 06 2012
MATHEMATICA
max = 30; s = Series[Sec[x]*Sech[x]+Tan[x]*(Sqrt[2]+Tanh[x]) /. x -> x/Sqrt[2], {x, 0, max+1}]; a[n_] := SeriesCoefficient[s, {x, 0, n}]*n!; Table[a[n], {n, 0, max}] (* Jean-François Alcover, Feb 25 2014 *)
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, If[t == 0,
Sum[b[u - j, o + j - 1, Mod[t + 1, 4]], {j, 1, u}],
Sum[b[u + j - 1, o - j, Mod[t + 1, 4]], {j, 1, o}]]];
a[n_] := b[n, 0, 0];
PROG
(Sage)
# Function A(m, n) defined in A181936.
A178964 = lambda n: (-1)^int(is_odd(n//4))*A(4, n)
print([A178964(n) for n in (0..30)]) # Peter Luschny, Jan 24 2017
(PARI) x='x+O('x^30); round(Vec(serlaplace((1+sqrt(2)*sin(x/sqrt(2))*cosh( x/sqrt(2)) + sin(x/sqrt(2))*sinh(x/sqrt(2)))/(cos(x/sqrt(2))*cosh(x/sqrt(2))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 31 2010
STATUS
approved