OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..450
FORMULA
From Alois P. Heinz, Jul 09 2023: (Start)
a(n) = Sum_{lambda in partitions(n)} (n - |lambda|)!.
EXAMPLE
a(4) = 12 = 6 + 2 + 2 + 1 + 1: (1234), (1243), (1324), (1342), (1423), (1432),
(13)(24), (14)(23), (1)(234), (1)(243), (1)(2)(34), (1)(2)(3)(4).
MAPLE
a:= n-> add((n-nops(p))!, p=combinat[partition](n)):
seq(a(n), n=0..24); # Alois P. Heinz, Jul 09 2023
# second Maple program:
b:= proc(n, i, p) option remember; `if`(n=0 or i=1,
(p-n)!, b(n, i-1, p)+b(n-i, min(n-i, i), p-1))
end:
a:= n-> b(n$3):
seq(a(n), n=0..24); # Alois P. Heinz, Jul 09 2023
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n == 0 || i == 1, (p - n)!, b[n, i - 1, p] + b[n - i, Min[n - i, i], p - 1]];
a[n_] := b[n, n, n];
Table[a[n], {n, 0, 24}] (* Jean-François Alcover, Aug 16 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alford Arnold, Aug 05 2010
EXTENSIONS
Edited by R. J. Mathar, May 17 2016
a(0), a(9)-a(23) and new name from Alois P. Heinz, Jul 09 2023
STATUS
approved