A258213 Number of permutations of {1,2,3,...,n} such that no even numbers are adjacent.
1, 1, 2, 6, 12, 72, 144, 1440, 2880, 43200, 86400, 1814400, 3628800, 101606400, 203212800, 7315660800, 14631321600, 658409472000, 1316818944000, 72425041920000, 144850083840000, 9560105533440000, 19120211066880000, 1491376463216640000, 2982752926433280000
Offset: 0
Keywords
Programs
-
Maple
a:= n-> (m-> m!^2*(m+1))(iquo(n+1, 2, 'r'))/(2-r): seq(a(n), n=0..24); # Alois P. Heinz, Feb 14 2024
-
PARI
T(n,k) = n!/(n-k)!; \\ A008279 a(n) = ceil(n/2)!*T(ceil(n/2)+1, n\2); \\ Michel Marcus, Nov 24 2022
Formula
a(n) = factorial(ceiling(n/2))*fallfac(ceiling(n/2)+1, floor(n/2)), with fallfac = A008279.
D-finite with recurrence: (4*(n-2)^2 + 24*n - 80)*a(n) + (16*n+24)*a(n-1) - (n+2)*n*((n-2)^2 + 8*n - 17)*a(n-2) = 0. - Georg Fischer, Nov 23 2022