OFFSET
0,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..449
Richard A. Brualdi and Emeric Deutsch, Adjacent q-cycles in permutations, arXiv:1005.0781 [math.CO], 2010.
FORMULA
a(n) = Sum_{j=0..floor(n/4)} (-1)^j*(n-3*j)!/j!.
a(n) - n*a(n-1) = 3*a(n-4) + 4*(-1)^{n/4} if 4|n otherwise a(n) - n*a(n-1) = 3*a(n-4).
a(n) = A177252(n,0).
limit_{n->oo} a(n)/n! = 1.
The o.g.f. g(z) satisfies z^2*(1+z^4)*g'(z) - (1+z^4)(1-z-3z^4)g(z) + 1 - 3z^4 = 0; g(0)=1.
D-finite with recurrence a(n) = n*a(n-1) + 2*a(n-4) + (n-4)*a(n-5) + 3*a(n-8). - R. J. Mathar, Jul 26 2022
G.f.: Sum_{k>=0} k! * x^k / (1+x^4)^(k+1). - Seiichi Manyama, Feb 20 2024
EXAMPLE
a(5)=118 because the only permutations of {1,2,3,4,5} having adjacent 4-cycles are (1234)(5) and (1)(2345).
MAPLE
a := proc (n) options operator, arrow: sum((-1)^j*factorial(n-3*j)/factorial(j), j = 0 .. floor((1/4)*n)) end proc: seq(a(n), n = 0 .. 22);
MATHEMATICA
a[n_] := Sum[(-1)^j*(n - 3*j)!/j!, {j, 0, n/4}];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 20 2017 *)
PROG
(Magma)
[(&+[(-1)^j*Factorial(n-3*j)/Factorial(j): j in [0..Floor(n/4)]]): n in [0..30]]; // G. C. Greubel, May 11 2024
(SageMath)
[sum((-1)^j*factorial(n-3*j)/factorial(j) for j in range(1+n//4)) for n in range(31)] # G. C. Greubel, May 11 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, May 07 2010
EXTENSIONS
Crossreferences corrected by Emeric Deutsch, May 09 2010
STATUS
approved