OFFSET
0,2
COMMENTS
Partial sums of A010872(n+1).
Essentially the same as A130481. - R. J. Mathar, Jun 13 2008
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
G.f.: (1+2x)/(1-x-x^3+x^4);
a(n) = 4/3 + n + 2*cos(Pi*2(n-1)/3)/3;
a(n) = Sum_{k=0..n} (k+1) mod 3;
a(n) = (n+1)*(n+2)/2 - 3*Sum_{k=0..n} floor((k+1)/3);
a(n) = 1 + n + Sum_{k=0..n} Jacobi(k, 3).
a(n) = a(n-1) + a(n-3) - a(n-4); a(0)=1, a(1)=3, a(2)=3, a(3)=4. - Harvey P. Dale, Sep 15 2011
a(n) = n + 1 when n + 2 is not a multiple of 3, and a(n) = n + 2 when n + 2 is a multiple of 3. - Dennis P. Walsh, Aug 06 2012
Sum_{n>=0} (-1)^n/a(n) = Pi/(3*sqrt(3)) + log(2)/3. - Amiram Eldar, Feb 14 2023
MAPLE
a:=n->add(chrem( [n, j], [1, 3] ), j=1..n):seq(a(n), n=1..72); # Zerinvary Lajos, Apr 08 2009
MATHEMATICA
f[n_]:=Mod[n, 3]; s=0; lst={}; Do[AppendTo[lst, s+=f[n]], {n, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *)
CoefficientList[Series[(1+2x)/((1-x)(1-x^3)), {x, 0, 80}], x] (* or *) LinearRecurrence[{1, 0, 1, -1}, {1, 3, 3, 4}, 81] (* Harvey P. Dale, Sep 15 2011 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Feb 24 2004
STATUS
approved