Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #32 Jul 08 2019 10:21:14
%S 0,0,2,6,26,130,782,5474,43794,394146,3941462,43356082,520272986,
%T 6763548818,94689683454,1420345251810,22725524028962,386333908492354,
%U 6954010352862374,132126196704385106,2642523934087702122,55493002615841744562,1220846057548518380366
%N Sum over all permutations without double ascents on n elements and each permutation contributes 2 raised to the power of the number of double descents.
%H R. Ehrenborg and J. Jung, <a href="http://dx.doi.org/10.1016/j.aam.2012.08.004">Descent pattern avoidance</a>, Adv. in Appl. Math., 49 (2012) 375-390.
%F E.g.f.: (exp(x)+exp(-x)-2)/(1-x).
%F a(n) = closest integer to (e-2+1/e)*n! for n > 3.
%F a(n) = (2-n)*a(n-3) + a(n-2) + n*a(n-1) for n > 2.
%F a(n) = 2*A080227(n).
%F a(n) = sum(0<=k<n, (-1)^(n-k-1)*binomial(n,k)*A002627(k)). - _Peter Luschny_, May 30 2014
%F 0 = a(n)*(+a(n+1) - a(n+2) - 3*a(n+3) + a(n+4)) + a(n+1)*(+a(n+1) + a(n+2) - 2*a(n+3)) + a(n+2)*(+a(n+2) + a(n+3) - a(n+4)) + a(n+3)*(+a(n+3)) if n>=0. - _Michael Somos_, May 30 2014
%e For n=3 the a(3)= 6 since the 4 permutations 132, 213, 231, 312 all contribute 1 and 321 contributes 2 to the sum. Note when n=4, the permutation 4321 contributes 4 since it has two double descents.
%e G.f. = 2*x^2 + 6*x^3 + 26*x^4 + 130*x^5 + 782*x^6 + 5474*x^7 + 43794*x^8 + ...
%p a := proc(n) if n < 2 then 0 elif n = 2 then 2 else (2-n)*a(n-3)+a(n-2)+n*a(n-1) fi end: seq(a(n), n=0..9); # _Peter Luschny_, May 30 2014
%t a[0] = 0; a[n_] := a[n] = n a[n-1] + (-1)^n + 1;
%t Array[a, 23, 0] (* _Jean-François Alcover_, Jul 08 2019, after A080227 *)
%Y Cf. A000166, A002627, A080227, A055596, A227918.
%K nonn
%O 0,3
%A _Richard Ehrenborg_, Oct 08 2013
%E a(0) and a(1) prepended, partially edited. - _Peter Luschny_, May 30 2014