OFFSET
0,2
COMMENTS
Original name of this sequence: Generalized Jacobsthal numbers.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
FORMULA
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), n>2.
a(n) = a(n-1) + 2*a(n-2) + 2, a(0)=1, a(1)=2.
G.f.: (1+x^2)/((1+x)*(1-x)*(1-2*x)).
E.g.f.: 5*exp(2*x)/3 - exp(x) + exp(-x)/3.
a(2*n+1) - 2 = 10*A000975(n).
a(2*n+2) - 6 = 20*A000975(n).
From Yosu Yurramendi, Jul 05 2016: (Start)
a(n+3) = 15*2^n - 2 - a(n), n >= 0, a(0)=1, a(1)=2, a(2)=6.
a(n) + A026644(n) = 3*2^n - 2, n >= 1.
a(n+3) = 3*2^(n+2) + A026644(n), n >= 1. (End)
MATHEMATICA
LinearRecurrence[{2, 1, -2}, {1, 2, 6}, 40] (* or *) Table[(5*2^n+(-1)^n-3)/3, {n, 0, 40}] (* Harvey P. Dale, Jan 29 2012 *)
PROG
(PARI) a(n)=(5*2^n)\/3-1 \\ Charles R Greathouse IV, Jul 01 2011
(Magma) [(5*2^n +(-1)^n)/3 -1: n in [0..35]]; // Vincenzo Librandi, Jul 05 2011
(SageMath) [(2/3)*(5*2^(n-1) -1 -(n%2)) for n in range(41)] # G. C. Greubel, Oct 11 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 18 2003
STATUS
approved