OFFSET
0,2
COMMENTS
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
a(n+2) - 2*a(n+1) + a(n) = period 3: repeat (3, 1, 2).
a(n+3) = a(n-3) + 4*(2 + 3*n). [Thus, a(n+3m) = a(n-3m) + 4m*(2 + 3n), and a(6m+k) = 4m*(9m + 3k + 2) + a(k): explicit formula for a(n) in terms of a(k), 0 <= k <= 5. - M. F. Hasler, Jun 06 2017]
O.g.f.: -x*(x+1)*(x+2) / ((x-1)^3*(x^2+x+1)). - Colin Barker, Sep 25 2015
E.g.f.: (x/3)*(3*x+7)*exp(x) - (2/(3*sqrt(3)))*exp(-x/2)*sin((sqrt(3)*x)/2). - G. C. Greubel, Sep 28 2015
(a(n+3) - a(n)) mod 2 = 1; (a(n+6) - a(n)) mod 2 = 0. - Altug Alkan, Sep 28 2015
(a(n) mod 2) = (0, 0, 1, 1, 1, 0) repeated. (a(n) mod 3) = (0, 2, 1, 1, 0, 2, 2, 1, 0) repeated. (a(n) mod 4) = (0, 2, 3, 1, 1, 0) repeated. (a(n) mod m) has a period of length 3*m, but for m = 4, 8, 12, ... also of length 3*m/2. - M. F. Hasler, Jun 06 2017
a(n) = n*(n+1) + floor((n+1)/3). - Bruno Berselli, Jun 06 2017
MATHEMATICA
LinearRecurrence[{2, -1, 1, -2, 1}, {0, 2, 7, 13, 21}, 101] (* Ray Chandler, Sep 24 2015 *)
RecurrenceTable[{a[n+3] == a[n] + 6 n + 13, a[0]==0, a[1]==2, a[2]==7}, a, {n, 0, 500}] (* G. C. Greubel, Sep 28 2015 *)
Table[n (n + 1) + Floor[(n + 1)/3], {n, 0, 50}] (* Bruno Berselli, Jun 06 2017 *)
PROG
(PARI) concat(0, Vec(-x*(x+1)*(x+2)/ ((x-1)^3*(x^2+x+1)) + O(x^100))) \\ Colin Barker, Sep 25 2015
(PARI) A262523(n)=(2+[9, 3]*n=divrem(n, 6))*4*n[1]+[0, 2, 7, 13, 21, 32][n[2]+1] \\ M. F. Hasler, Jun 06 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 24 2015
STATUS
approved