OFFSET
0,2
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..300
Klaus Brockhaus, Illustration for A081134, A081249, A081250 and A081251
Index entries for linear recurrences with constant coefficients, signature (3,1,-3).
FORMULA
a(n) = floor(3^n*5/4).
G.f.: x*(1+x^2)/((1-x)*(1+x)*(1-3*x)).
a(n) = 3*a(n-1) + 1*a(n-2) - 3*a(n-3).
a(n) = (5*3^n + (-1)^n - 2)/4. - Paul Barry, May 19 2003
a(n) = a(n-2) + 10*3^(n-2) for n > 1.
a(n+2) - a(n) = A005052(n).
a(2*n) = Sum_{j=1..n+1} A062107(2*j).
a(2*n+1) = Sum_{j=1..n+1} A062107(2*j+1).
With a leading 0, this is a(n) = (5*3^n - 6 + 4*0^n - 3*(-1)^n)/12, the binomial transform of A084183. - Paul Barry, May 19 2003
Convolution of 3^n and {1, 0, 2, 0, 2, 0, ...}. a(n) = Sum_{k=0..n} ((1 + (-1)^k) - 0^k)*3^(n-k) = Sum_{k=0..n} ((1 + (-1)^(n-k)) - 0^(n-k))3^k. - Paul Barry, Jul 19 2004
a(n) = 2*a(n-1) + 3*a(n-2) + 2, a(0)=1, a(1)=3. - Zerinvary Lajos, Apr 28 2008
EXAMPLE
MAPLE
a[0]:=1:a[1]:=3:for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]+2 od: seq(a[n], n=0..30); # Zerinvary Lajos, Apr 28 2008
MATHEMATICA
Floor[5*3^Range[0, 30]/4] (* Wesley Ivan Hurt, Mar 30 2017 *)
PROG
(Magma) [Floor(3^n*5/4): n in [0..30]]; // Vincenzo Librandi, Jun 10 2011
(PARI) vector(30, n, n--; (5*3^n +(-1)^n -2)/4) \\ G. C. Greubel, Jul 14 2019
(Sage) [(5*3^n +(-1)^n -2)/4 for n in (0..30)] # G. C. Greubel, Jul 14 2019
(GAP) List([0..30], n-> (5*3^n +(-1)^n -2)/4) # G. C. Greubel, Jul 14 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Mar 17 2003
EXTENSIONS
Offset changed from 1 to 0 by Vincenzo Librandi, Jun 10 2011
STATUS
approved