login
A166022
a(n) = 3*a(n-1) -2*a(n-2) -a(n-3) +3*a(n-4) -2*a(n-5) for n > 4, with initial values as shown.
1
0, 1, 2, 2, 4, 9, 21, 43, 86, 170, 340, 681, 1365, 2731, 5462, 10922, 21844, 43689, 87381, 174763, 349526, 699050, 1398100, 2796201, 5592405, 11184811, 22369622, 44739242, 89478484, 178956969, 357913941, 715827883, 1431655766, 2863311530, 5726623060, 11453246121
OFFSET
0,3
COMMENTS
a(n+1)-2*a(n) defines a periodic sequence with period length 6: 1, 0, -2, 0, 1, 3 (repeat).
The sequence a(n) and its iterated differences in successive lines are:
..0, 1, .2, .2, .4, .9, 21, 43, 86, 170, 340,...
..1, 1, .0, .2, .5, 12, 22, 43, 84, 170, 341,...
..0,-1, .2, .3, .7, 10, 21, 41, 86, 171, 343,...
.-1, 3, .1, .4, .3, 11, 20, 45, 85, 172, 339,...
..4,-2, .3, -1, .8, .9, 25, 40, 87, 167, 344,...
.-6, 5, -4, .9, .1, 16, 15, 47, 80, 177, 337,...
.11,-9, 13, -8, 15, -1, 32, 33, 97, 160, 351,...
-20,22,-21, 23,-16, 33, .1, 64, 63, 191, 320,...
On the main diagonal of this array we recognize the powers of 2, A131577.
FORMULA
a(n) = 2^n/3 - 1/2 + (-1)^n/6 + A010892(n-1). - R. J. Mathar, Oct 06 2009
G.f.: x*(1 - x - 2*x^2 + 3*x^3)/((x-1) * (2*x-1) * (1+x) * (x^2-x+1)). - R. J. Mathar, Oct 06 2009
MATHEMATICA
LinearRecurrence[{3, -2, -1, 3, -2}, {0, 1, 2, 2, 4}, 40] (* Harvey P. Dale, Mar 13 2014 *)
CoefficientList[Series[x (1 - x - 2 x^2 + 3 x^3)/((x - 1) (2 x - 1) (1 + x) (x^2 - x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 15 2014 *)
PROG
(PARI) concat(0, Vec(x*(1-x-2*x^2+3*x^3)/((x-1)*(2*x-1)*(1+x)*(x^2-x+1))+O(x^50))) \\ Jinyuan Wang, Feb 26 2020
CROSSREFS
Sequence in context: A052935 A365091 A246789 * A052925 A006182 A267339
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 04 2009
EXTENSIONS
Extended by R. J. Mathar, Oct 06 2009
STATUS
approved