login
a(n) = 3*n! - 1.
6

%I #16 Oct 14 2024 15:38:05

%S 2,2,5,17,71,359,2159,15119,120959,1088639,10886399,119750399,

%T 1437004799,18681062399,261534873599,3923023103999,62768369663999,

%U 1067062284287999,19207121117183999,364935301226495999

%N a(n) = 3*n! - 1.

%H Vincenzo Librandi, <a href="/A173323/b173323.txt">Table of n, a(n) for n = 0..200</a>

%F a(0)=2, a(n) = n*a(n-1)+n-1. - _Vincenzo Librandi_, Sep 30 2013

%F D-finite with recurrence a(n) +(-n-2)*a(n-1) +(2*n-1)*a(n-2) +(-n+2)*a(n-3)=0. - _R. J. Mathar_, Mar 07 2022

%F E.g.f.: 3/(1 - x) - exp(x). - _Stefano Spezia_, Oct 14 2024

%t Table[3 n! - 1, {n, 0, 25}] (* _Vincenzo Librandi_, Sep 30 2013 *)

%t 3*(Range[0,20]!)-1 (* _Harvey P. Dale_, Oct 27 2015 *)

%o (Magma) [3*Factorial(n)-1: n in [0..25]]; /* or */ [2] cat [n eq 1 select n+1 else n*Self(n-1)+n-1: n in [1..25] ]; // _Vincenzo Librandi_, Sep 30 2013

%Y Cf. sequences of the type k*n!-1: A033312 (k=1), A020543 (k=2), this sequence, A173321 (k=4), A173317 (k=5), A173316 (k=6).

%K nonn,easy

%O 0,1

%A _Vincenzo Librandi_, Feb 16 2010