login
a(n) = n! * [x^n] -x*(x + 1)*exp(x)/(x - 1)^3.
1

%I #13 Apr 20 2021 10:11:18

%S 0,1,10,81,652,5545,50886,506905,5480056,64116657,808856290,

%T 10959016321,158851484100,2454385635481,40285778016862,

%U 700261611998985,12853532939027056,248482678808005345,5047002269952482106,107466341437781300017,2394019421567804960380

%N a(n) = n! * [x^n] -x*(x + 1)*exp(x)/(x - 1)^3.

%F a(n) = Sum_{k=0..n} rf(n - k + 1, k)*k^2, where rf is the rising factorial.

%F a(n) = (2 + n*(n + 2))*a(n - 1)/(n - 1) - (n + 1)*a(n - 2) for n >= 3.

%F A002775(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n, k)*a(k).

%p egf := -x*(x + 1)*exp(x)/(x - 1)^3: ser := series(egf, x, 32):

%p seq(n!*coeff(ser, x, n), n = 0..20);

%t a[n_] := Sum[Pochhammer[n - k + 1, k]*k^2, {k, 0, n}];

%t Table[a[n], {n, 0, 20}]

%o (SageMath)

%o def a(n): return sum(rising_factorial(n - k + 1, k)*k^2 for k in (0..n))

%o print([a(n) for n in (0..20)])

%o (Python)

%o def a():

%o a, b, n = 0, 1, 2

%o yield 0

%o while True:

%o yield b

%o a, b = b, -(n + 1)*a + ((2 + n*(n + 2))*b)//(n - 1)

%o n += 1

%o A343276 = a(); print([next(A343276) for _ in range(21)])

%Y Cf. A002775, A093964.

%K nonn

%O 0,3

%A _Peter Luschny_, Apr 20 2021