OFFSET
0,2
COMMENTS
Define a triangle T by T(n,0) = n*(n+1) + 1, T(n,n) = (n+1)*(n+2)/2, and T(r,c) = T(r-1,c) + T(r-1,c-1) + T(r-2,c-1). Then a(n) is the sum of row n. - J. M. Bergot, Mar 06 2013
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-4,0,1).
FORMULA
a(n) = 2*a(n-1) + a(n-2) + 3*n + 1, with a(0)=1, a(1)=6.
a(n) = ( ((13 + 9*sqrt(2))/2)*(1 + sqrt(2))^n - ((13 - 9*sqrt(2))/2)*(1 -sqrt(2))^n )/2*sqrt(2) - (3*n + 7)/2.
From R. J. Mathar, Nov 08 2012: (Start)
G.f.: (1 + 2*x) / ( (1-x-x^2)*(1-x)^2 ).
a(n) = (Pell(n+3) + 2*Pell(n+2) - 3*n - 7)/2, where Pell(n) = A000129(n). - G. C. Greubel, Aug 09 2022
MATHEMATICA
Table[(Fibonacci[n+3, 2] +2*Fibonacci[n+2, 2] -(3*n+7))/2, {n, 0, 40}] (* G. C. Greubel, Aug 09 2022 *)
PROG
(PARI)
N=66; x='x+O('x^N);
gf= ( -1-2*x ) / ( (x^2+2*x-1)*(x-1)^2 ); Vec(Ser(gf))
/* Joerg Arndt, Mar 07 2013 */
(Magma) I:=[1, 6, 20, 56]; [n le 4 select I[n] else 4*Self(n-1) - 4*Self(n-2) + Self(n-4): n in [1..41]]; // G. C. Greubel, Aug 09 2022
(SageMath) [(lucas_number1(n+3, 2, -1) + 2*lucas_number1(n+2, 2, -1) -3*n-7)/2 for n in (0..40)] # G. C. Greubel, Aug 09 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
EXTENSIONS
Corrected by T. D. Noe, Nov 08 2006
STATUS
approved