login
a(n) = Sum_{d|n} (d-1)! * d^(n/d).
1

%I #17 Aug 30 2023 02:00:43

%S 1,3,7,29,121,747,5041,40433,362935,3629433,39916801,479006531,

%T 6227020801,87178326609,1307674371487,20922790212353,355687428096001,

%U 6402373709021811,121645100408832001,2432902008212950169,51090942171709691335,1124000727778046766849

%N a(n) = Sum_{d|n} (d-1)! * d^(n/d).

%F G.f.: Sum_{k>0} k! * x^k/(1 - k * x^k).

%F If p is prime, a(p) = 1 + p!.

%t a[n_] := DivisorSum[n, (# - 1)! * #^(n/#) &]; Array[a, 22] (* _Amiram Eldar_, Aug 30 2023 *)

%o (PARI) a(n) = sumdiv(n, d, (d-1)!*d^(n/d));

%o (PARI) my(N=30, x='x+O('x^N)); Vec(sum(k=1, N, k!*x^k/(1-k*x^k)))

%Y Cf. A038507, A062363, A078308, A217576, A321521, A358280.

%K nonn,easy

%O 1,2

%A _Seiichi Manyama_, Nov 08 2022