OFFSET
0,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6).
FORMULA
a(n) = 2^n - cos(Pi*n/3) - 3^(n/2)*sin(Pi*n/6)/sqrt(3).
O.g.f.: -x(1-3x+3x^2+x^3)/[(2x-1)(x^2-x+1)(3x^2-3x+1)]. - R. J. Mathar, Apr 02 2008
MATHEMATICA
Table[Sum[Binomial[n, k] * Mod[k*Floor[3*(k+1)/2] - 2*k, 3], {k, 0, n}], {n, 0, 40}] (* Vaclav Kotesovec, Oct 30 2017 *)
CoefficientList[Series[-x(1-3x+3x^2+x^3)/((2x-1)(x^2-x+1)(3x^2-3x+1)), {x, 0, 40}], x] (* or *) LinearRecurrence[{6, -15, 20, -15, 6}, {0, 1, 3, 6, 12}, 40] (* Harvey P. Dale, Aug 28 2025 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 06 2003
STATUS
approved
