OFFSET
0,1
COMMENTS
From 1, the last digit is a periodic sequence of length 4:repeat [1, 6, 7, 8].
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) = 4^n + 2. a(2n+1) = 2*4^n - 1.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), n>2.
a(n) = 2^n + periodic sequence of length 2: repeat [2, -1].
a(n) = 2^(n+2) - A280173(n).
a(n+2) = a(n) + 3*2^n, a(0) = 3, a(1) = 1.
G.f.: (3-5*x+x^2) / ((1-x)*(1+x)*(1-2*x)). - Colin Barker, Dec 31 2016
MATHEMATICA
LinearRecurrence[{2, 1, -2}, {3, 1, 6}, 50] (* Paolo Xausa, Nov 13 2023 *)
PROG
(PARI) Vec((3-5*x+x^2) / ((1-x)*(1+x)*(1-2*x)) + O(x^40)) \\ Colin Barker, Dec 31 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Dec 31 2016
EXTENSIONS
More terms from Colin Barker, Dec 31 2016
STATUS
approved