OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Clark's Triangle.
Index entries for linear recurrences with constant coefficients, signature (3,-2).
FORMULA
a(0)=0; for n>0, a(n) = 13*2^(n-1) - 6. - Max Alekseyev, May 12 2005
From Chai Wah Wu, May 28 2016: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) for n > 1.
G.f.: x*(7 - x)/((1 - x )*(1 - 2*x)). (End)
E.g.f.: (1/2)*(13*exp(2*x) - 12*exp(x) - 1). - G. C. Greubel, Apr 02 2024
EXAMPLE
a(0) = 0.
a(1) = 6 + 1.
a(2) = 12 + 7 + 1.
a(3) = 18 + 19 + 8 + 1.
a(4) = 24 + 37 + 27 + 9 + 1.
MATHEMATICA
Join[{0}, Table[13 2^(n-1) - 6, {n, 1, 40}]] (* Vincenzo Librandi, May 29 2016 *)
LinearRecurrence[{3, -2}, {0, 7, 20}, 30] (* Harvey P. Dale, Jul 07 2024 *)
PROG
(PARI) {a(n) = if(n, 13*2^(n-1)-6, 0)} \\ Max Alekseyev, May 12 2005
(Magma) [0] cat [13*2^(n-1)-6: n in [1..40]]; // Vincenzo Librandi, May 29 2016
(SageMath) [(13*2^n - 12 - int(n==0))/2 for n in range(41)] # G. C. Greubel, Apr 02 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jorge Coveiro, Dec 28 2004
EXTENSIONS
More terms from Max Alekseyev, May 12 2005
STATUS
approved