A084640 Generalized Jacobsthal numbers.
0, 1, 5, 11, 25, 51, 105, 211, 425, 851, 1705, 3411, 6825, 13651, 27305, 54611, 109225, 218451, 436905, 873811, 1747625, 3495251, 6990505, 13981011, 27962025, 55924051, 111848105, 223696211, 447392425, 894784851, 1789569705, 3579139411
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Wolfdieter Lang, Notes on certain inhomogeneous three term recurrences. [From _Wolfdieter Lang_, Oct 18 2010]
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Programs
-
Haskell
a084640 n = a084640_list !! n a084640_list = 0 : 1 : (map (+ 4) $ zipWith (+) (map (* 2) a084640_list) (tail a084640_list)) -- Reinhard Zumkeller, May 23 2013
-
Magma
[5*2^n/3+(-1)^n/3-2: n in [0..35]]; // Vincenzo Librandi, Jun 15 2011
-
Mathematica
LinearRecurrence[{2,1,-2},{0,1,5},40] (* Harvey P. Dale, Oct 27 2015 *)
-
PARI
x='x+O('x^50); Vec(x*(1+3*x)/((1-x^2)*(1-2*x))) \\ G. C. Greubel, Sep 26 2017
Formula
G.f.: x*(1+3*x)/((1-x^2)*(1-2*x)).
a(n) = a(n-1) + 2a(n-2) + 4, a(0)=0, a(1)=1.
a(n) = (5*2^n + (-1)^n - 6)/3.
a(n+1) - 2*a(n) = period 2: repeat 1, 3. - Paul Curtz, Apr 03 2008
Contribution from Paul Curtz, Dec 10 2009: (Start)
a(n+2) - a(n) = A020714(n).
Le the array D(n,k) of the first differences be defined via D(0,k) = a(k); D(n+1,k) = D(n,k+1)-D(n,k).
Then D(n,n) = 4*A131577(n); D(1,k) = A084214(k+1); D(2,k) = A115102(k-1) for k>0; D(3,k) = (-1)^(k+1)*A083581(k). (End)
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), a(0)=0, a(1)=1, a(2)=5. Observed by G. Detlefs. See the W. Lang link. - Wolfdieter Lang, Oct 18 2010
Comments