OFFSET
0,1
COMMENTS
a(n) mod 9 is a periodic sequence of length 2: repeat [3, 7].
From 7, the last digit is of period 4: repeat [7, 2, 5, 8].
(Main sequence for the signature (2,1,-2): 0, 0, 1, 2, 5, 10, 21, 42, ... = 0 followed by A000975(n) = b(n), which first differences are A001045(n) (Paul Barry, Oct 08 2005). Then, 0 followed by b(n) is an autosequence of the first kind. The corresponding autosequence of the second kind is 0, 0, 2, 3, 8, 15, 32, 63, ... . See A277078(n).)
Difference table of a(n):
3, 7, 12, 25, 48, 97, 192, ...
4, 5, 13, 23, 49, 95, 193, ... = -(-1)^n* A140683(n)
1, 8, 10, 26, 46, 98, 190, ... = A259713(n)
7, 2, 16, 20, 52, 92, 196, ...
-5, 14, 4, 32, 40, 104, 184, ...
... .
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
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).
EXAMPLE
a(0) = 3, a(1) = 2*3 + 1 = 7, a(2) = 2*7 - 2 = 12, a(3) = 2*12 + 1 = 25.
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 *)
PROG
(PARI) Vec((3 + x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Jan 01 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jan 01 2017
EXTENSIONS
More terms from Colin Barker, Jan 01 2017
STATUS
approved