OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = A034720(n) + 1 for n > 0, where +1 counts the empty string.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Vincenzo Librandi, Jun 21 2012
G.f.: (1 - 2*x + 15x^2 + 6x^3)/(1-x)^4. - Bruno Berselli, Jun 21 2012
E.g.f.: (3 + 3*x + 21*x^2 + 10*x^3)*exp(x)/3. - G. C. Greubel, Nov 11 2019
MAPLE
seq((10*n^3 -9*n^2 +2*n +3)/3, n=0..40); # G. C. Greubel, Nov 11 2019
MATHEMATICA
LinearRecurrence[{4, -6, 4, -1}, {1, 2, 17, 66}, 40] (* Vincenzo Librandi, Jun 21 2012 *)
PROG
(PARI) a(n)=(10*n^3-9*n^2+2*n)/3+1 \\ Charles R Greathouse IV, Dec 08 2011
(Magma) I:=[1, 2, 17, 66]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jun 21 2012
(Sage) [(10*n^3 -9*n^2 +2*n +3)/3 for n in (0..40)] # G. C. Greubel, Nov 11 2019
(GAP) List([0..40], n-> (10*n^3 -9*n^2 +2*n +3)/3); # G. C. Greubel, Nov 11 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by Frank Ellermann, Mar 13 2002
STATUS
approved