OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Wikipedia, Quasi-polynomial.
Index entries for linear recurrences with constant coefficients, signature (3,-6,10,-12,12,-10,6,-3,1).
FORMULA
a(n) = n*(n+7)/(2*mod(1 + floor(n/2), 2) + 2).
G.f.: x*(2 + 3*x + 6*x^4 - 6*x^5 + 4*x^6 - 3*x^7)/(1 - x + x^2 - x^3)^3.
From Peter Bala, Aug 07 2022: (Start)
a(n) = numerator of n*(n+7)/4.
a(n) is quasi-polynomial in n: if p(n) = n*(n+7)/4 then a(4*n) = p(4*n), a(4*n+1) = p(4*n+1), a(4*n+2) = 2*p(4*n+2) and a(4*n+3) = 2*p(4*n+3) = A303295(n+1) for n >= 1. (End)
Sum_{n>=1} 1/a(n) = 697/735 + Pi/14. - Amiram Eldar, Aug 16 2022
MATHEMATICA
a[n_] := n*(n+7)/(2*Mod[1 + Floor[n/2], 2] + 2); Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 01 2012 *)
CoefficientList[Series[x (2 + 3 x + 6 x^4 - 6 x^5 + 4 x^6 - 3 x^7) / (1 - x + x^2 - x^3)^3, {x, 0, 33}], x] (* Vincenzo Librandi, Jul 17 2013 *)
PROG
(PARI) my(x='x+O('x^50)); Vec(x*(2+3*x+6*x^4-6*x^5+4*x^6-3*x^7)/(1-x+x^2-x^3)^3) \\ G. C. Greubel, Sep 20 2018
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(2+3*x+6*x^4-6*x^5+4*x^6-3*x^7)/(1-x+x^2-x^3)^3)); // G. C. Greubel, Sep 20 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jean-François Alcover, Oct 01 2012
STATUS
approved