A280345 a(0) = 3, a(n+1) = 2*a(n) + periodic sequence of length 2: repeat [1, -2].
3, 7, 12, 25, 48, 97, 192, 385, 768, 1537, 3072, 6145, 12288, 24577, 49152, 98305, 196608, 393217, 786432, 1572865, 3145728, 6291457, 12582912, 25165825, 50331648, 100663297, 201326592, 402653185, 805306368, 1610612737, 3221225472, 6442450945, 12884901888
Offset: 0
Examples
a(0) = 3, a(1) = 2*3 + 1 = 7, a(2) = 2*7 - 2 = 12, a(3) = 2*12 + 1 = 25.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Programs
-
Mathematica
a[0] = 3; a[n_] := a[n] = 2 a[n - 1] + 1 + (-3) Boole[EvenQ@ n]; Table[a@ n, {n, 0, 32}] (* or *) CoefficientList[Series[(3 + x - 5 x^2)/((1 - x) (1 + x) (1 - 2 x)), {x, 0, 32}], x] (* Michael De Vlieger, Jan 01 2017 *)
-
PARI
Vec((3 + x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Jan 01 2017
Formula
a(2n) = 3*4^n, a(2n+1) = 6*4^n + 1.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), n>2.
a(n+2) = a(n) + 9*2^n.
a(n) = 2^(n+2) - A051049(n).
From Colin Barker, Jan 01 2017: (Start)
a(n) = 3*2^n for n even.
a(n) = 3*2^n + 1 for n odd.
G.f.: (3 + x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)).
(End)
Binomial transform of 3, followed by (-1)^n* A140657(n).
Extensions
More terms from Colin Barker, Jan 01 2017
Comments