Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #25 Oct 31 2020 02:03:31
%S 0,3,72,1557,36928,986550,29641608,994006209,36887753216,
%T 1502798312547,66730937637400,3209318261685690,166242143849148864,
%U 9229638177763268395,546842961612529341032,34443269219453881669425
%N a(n) = (1/e^n) * Sum_{j>=2} j^n * n^j / (j-2)!.
%F a(n) = Sum_{k=0..n+2} n^k*(Stirling2(n+2,k) - Stirling2(n+1,k)). [Thanks to _Andrew Howroyd_ for his example in A338282]
%e a(3) = 1557 = (1/e^3) * Sum_{j>=2} j^3 * 3^j / factorial(j-2).
%t a[n_] := Sum[n^k*(StirlingS2[n + 2, k] - StirlingS2[n + 1, k]), {k, 2, n + 2}]; Array[a, 16, 0] (* _Amiram Eldar_, Oct 30 2020 *)
%o (SageMath) # Increase precision for larger n!
%o R = RealField(100)
%o t = 2
%o sol = [0]*18
%o for n in range(0, 18):
%o suma = R(0)
%o for j in range(t, 1000):
%o suma += (j^n * n^j) / factorial(j - t)
%o suma *= exp(-n)
%o sol[n] = round(suma)
%o print(sol) # Thanks to _Peter Luschny_ for his example in A338282.
%o (PARI) a(n) = sum(k=0, n+2, n^k*(stirling(n+2,k,2) - stirling(n+1,k,2))); \\ _Michel Marcus_, Oct 30 2020
%Y Cf. A005494, A143495, A242817, A299824, A338282.
%K nonn
%O 0,2
%A _Pedro Caceres_, Oct 30 2020