OFFSET
0,2
FORMULA
a(2k) = 2^k k! + \sum_{j=0}^{k-1}(k-j-1)! a(2j)
a(2k+1) = (2^k + 1)k! + \sum_{j=0}^{k-1}(k-j-1)! a(2j+1)
EXAMPLE
For n = 2, the permutations are (1, 2), (2, 1), (-1, -2), (-2, -1).
MATHEMATICA
a[n_] := a[n] = If[EvenQ[n],
Sum[a[2j]*(n/2 - j - 1)!, {j, 0, n/2 - 1}] + 2^(n/2)*(n/2)!,
Sum[a[2j+1]*((1/2)*(n - 2j - 3))!, {j, 0, (n - 3)/2}] +
(2^((n - 1)/2) + 1)*((n - 1)/2)!];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Apr 10 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Andy Hardt, Aug 04 2011
STATUS
approved