a(n)=a(n-2)+a(n-3)-a(n-5); a(n)=cos(2*pi*n/3+pi/3)/3-sin(2*pi*n/3+pi/3)/sqrt(3)+3(-1)^n/4+(6n+7)/12; a(n)=sum{k=0..floor(n/2),2*A001045(L((n-2k+2)/3))} where L(j/p) is the Legendre symbol of j and p.

PROG

(Maxima) a(n):=(n+1)/2+3/4*(-1)^n+1/12-(1/3)*(-2)^fix(mod(n, 3)/2); Tani Akinari, Nov 10 2012