login
E.g.f.: exp(x+x^2+x^3+x^4).
3

%I #29 Sep 08 2022 08:45:58

%S 1,1,3,13,73,381,2611,19993,165873,1436473,14004451,145099461,

%T 1584090553,18196817653,223416271443,2865429498961,38330181602401,

%U 535448870264433,7823019065848003,118402856414023933,1856454825152993961,30160691907215561581

%N E.g.f.: exp(x+x^2+x^3+x^4).

%H Alois P. Heinz, <a href="/A193930/b193930.txt">Table of n, a(n) for n = 0..524</a>

%F a(n) = n!*sum(k=1..n, sum(i=0..(n-k)/4, (-1)^i*binomial(k,k-i)*binomial(n-4*i-1,k-1))/k!), n>0, a(0)=1.

%F a(n) = a(n-1) + 2*(n-1)*a(n-2) + 3*(n-1)(n-2)*a(n-3) + 4*(n-1)*(n-2)*(n-3)*a(n-4). - _Geoffrey Critzer_, Oct 11 2014

%p A193930:=n->`if`(n=0,1,n!*add(add( (-1)^i*binomial(k,k-i)*binomial(n-4*i-1,k-1)/k!, i=0..(n-k)/4), k=1..n)): seq(A193930(n), n=0..20); # _Wesley Ivan Hurt_, Oct 11 2014

%p # second Maple program:

%p a:= proc(n) option remember; `if`(n=0, 1, add(

%p a(n-j)*binomial(n-1, j-1)*j!, j=1..min(n, 4)))

%p end:

%p seq(a(n), n=0..23); # _Alois P. Heinz_, Sep 29 2017

%t RecurrenceTable[{a[n] == a[n - 1] + 2 (n - 1) a[n - 2] + (n - 1) (n - 2) 3 a[n - 3] + (n - 1) (n - 2) (n - 3) 4 a[n - 4], a[0] == 1,

%t a[1] == 1, a[2] == 3, a[3] == 13}, a, {n, 0, 20}] (* _Geoffrey Critzer_, Oct 11 2014 *)

%t With[{nn=30},CoefficientList[Series[Exp[x+x^2+x^3+x^4],{x,0,nn}],x] Range[ 0,nn]!] (* _Harvey P. Dale_, Aug 20 2021 *)

%o (Maxima)

%o a(n):=if n=0 then 1 else n!*sum(sum((-1)^i*binomial(k,k-i)*binomial(n-4*i-1,k-1),i,0,(n-k)/4)/k!,k,1,n);

%o (PARI) x = y + O(y^50); concat(0, Vec(serlaplace(exp(x+x^2+x^3+x^4)))) \\ _Michel Marcus_, Oct 12 2014

%o (Magma) I:=[1,1,3,13]; [n le 4 select I[n] else Self(n-1)+2*(n-2)*Self(n-2)+3*(n-2)*(n-3)*Self(n-3)+4*(n-2)*(n-3)*(n-4)*Self(n-4): n in [1..25]]; // _Vincenzo Librandi_, Oct 12 2014

%Y Cf. A047974, A118589.

%K nonn

%O 0,3

%A _Vladimir Kruchinin_, Aug 09 2011