login
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

%I #15 Feb 26 2020 21:50:41

%S 0,1,2,2,4,9,21,43,86,170,340,681,1365,2731,5462,10922,21844,43689,

%T 87381,174763,349526,699050,1398100,2796201,5592405,11184811,22369622,

%U 44739242,89478484,178956969,357913941,715827883,1431655766,2863311530,5726623060,11453246121

%N 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.

%C a(n+1)-2*a(n) defines a periodic sequence with period length 6: 1, 0, -2, 0, 1, 3 (repeat).

%C The sequence a(n) and its iterated differences in successive lines are:

%C ..0, 1, .2, .2, .4, .9, 21, 43, 86, 170, 340,...

%C ..1, 1, .0, .2, .5, 12, 22, 43, 84, 170, 341,...

%C ..0,-1, .2, .3, .7, 10, 21, 41, 86, 171, 343,...

%C .-1, 3, .1, .4, .3, 11, 20, 45, 85, 172, 339,...

%C ..4,-2, .3, -1, .8, .9, 25, 40, 87, 167, 344,...

%C .-6, 5, -4, .9, .1, 16, 15, 47, 80, 177, 337,...

%C .11,-9, 13, -8, 15, -1, 32, 33, 97, 160, 351,...

%C -20,22,-21, 23,-16, 33, .1, 64, 63, 191, 320,...

%C On the main diagonal of this array we recognize the powers of 2, A131577.

%H Vincenzo Librandi, <a href="/A166022/b166022.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-1,3,-2).

%F a(n) = 2^n/3 - 1/2 + (-1)^n/6 + A010892(n-1). - _R. J. Mathar_, Oct 06 2009

%F 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

%t LinearRecurrence[{3,-2,-1,3,-2},{0,1,2,2,4},40] (* _Harvey P. Dale_, Mar 13 2014 *)

%t 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 *)

%o (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

%K nonn,easy

%O 0,3

%A _Paul Curtz_, Oct 04 2009

%E Extended by _R. J. Mathar_, Oct 06 2009