OFFSET
0,5
COMMENTS
The differences between the terms are (1) a(3*k) - a(3*k-1) = 9*k*(k-1)+1; (2) otherwise, a(n) - a(n-1) = (n-2)*(n-1). - J. M. Bergot, Jul 10 2013
Second differences give A047266. - J. M. Bergot, Dec 01 2014
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (3,-3,2,-3,3,-1).
FORMULA
From R. J. Mathar, Aug 15 2010: (Start)
a(n) = ( (n-1)*(n^2-2*n-1) - A057078(n))/3.
G.f.: x^3*(1+4*x+x^2) / ( (1+x+x^2)*(x-1)^4 ). (End)
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) - 3*a(n-4) + 3*a(n-5) - a(n-5). - Charles R Greathouse IV, Jul 10 2013
a(3n) = n*(9n^2-9n+1), a(3n+1) = n*(9n^2-2), a(3n+2) = n*(9n^2+9n+1). - Ralf Stephan, Jul 12 2013
a(n) = ceiling((n^3 - 3*n^2 + n)/3). - Robert Israel, Dec 01 2014
E.g.f.: (3*exp(x)*(1 - x + x^3) - exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)))/9. - Stefano Spezia, Mar 04 2023
MAPLE
seq(ceil((n^3 - 3*n^2 + n)/3), n=0..100); # Robert Israel, Dec 01 2014
MATHEMATICA
k0=k1=0; lst={k0, k1}; Do[kt=k1; k1=n^3-k1-k0; k0=kt; AppendTo[lst, k1], {n, 1, 4!}]; lst
LinearRecurrence[{3, -3, 2, -3, 3, -1}, {0, 0, 0, 1, 7, 19}, 50] (* G. C. Greubel, Sep 01 2018 *)
PROG
(PARI) x='x+O('x^50); concat([0, 0, 0], Vec(x^3*(1+4*x+x^2)/((1+x+x^2)*(x -1)^4 ))) \\ G. C. Greubel, Sep 01 2018
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); [0, 0, 0] cat Coefficients(R!(x^3*(1+4*x+x^2)/((1+x+x^2)*(x-1)^4))); // G. C. Greubel, Sep 01 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Joseph Stephan Orlovsky, Dec 11 2008
STATUS
approved