%I #26 May 02 2024 04:28:50
%S 0,0,0,0,0,0,1,3,12,57,348,2460,19806,178950,1794420,19778210,
%T 237696420,3093642300,43350548655,650733622665,10417925247240,
%U 177191430300339,3190747212651432,60645032890871688,1213255040678034508,25484737348664027532,560785511736390349080
%N Number of permutations of [n] having exactly two adjacent 3-cycles.
%H G. C. Greubel, <a href="/A370528/b370528.txt">Table of n, a(n) for n = 0..450</a>
%H R. A. Brualdi and Emeric Deutsch, <a href="http://arxiv.org/abs/1005.0781">Adjacent q-cycles in permutations</a>, arXiv:1005.0781 [math.CO], 2010.
%F G.f.: (1/2) * Sum_{k>=2} k! * x^(k+4) / (1+x^3)^(k+1).
%F a(n) = (1/2) * Sum_{k=0..floor(n/3)-2} (-1)^k * (n-2*k-4)! / k!.
%t Table[Sum[(-1)^k*(n-2*k-4)!/k!, {k,0,Floor[(n-6)/3]}]/2, {n,0,30}] (* _G. C. Greubel_, May 01 2024 *)
%o (PARI) my(N=30, x='x+O('x^N)); concat([0, 0, 0, 0, 0, 0], Vec(sum(k=2, N, k!*x^(k+4)/(1+x^3)^(k+1))/2))
%o (PARI) a(n, k=2, q=3) = sum(j=0, n\q-k, (-1)^j*(n-(q-1)*(j+k))!/j!)/k!;
%o (Magma)
%o [n le 5 select 0 else (&+[(-1)^k*Factorial(n-2*k-4)/Factorial(k): k in [0..Floor((n-6)/3)]])/2: n in [0..30]]; // _G. C. Greubel_, May 01 2024
%o (SageMath)
%o [sum((-1)^k*factorial(n-2*k-4)/factorial(k) for k in range(1+(n-6)//3))/2 for n in range(31)] # _G. C. Greubel_, May 01 2024
%Y Column k=2 of A177250.
%Y Cf. A177251, A370525, A370530.
%K nonn
%O 0,8
%A _Seiichi Manyama_, Feb 21 2024