OFFSET
0,2
COMMENTS
Row sums of A117908.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1)
FORMULA
G.f.: (1 +2*x +x^3)/(1-x^3)^2.
a(n) = Sum_{k=0..n} 0^abs(L(C(n,2)/3) - 2*L(C(k,2)/3)) where L(j/p) is the Legendre symbol of j and p.
a(n) = sin((n+1)*Pi/3)*((8*n+14)*sin((n+1)*Pi/3) - sqrt(3)*cos(n*Pi))/9. - Wesley Ivan Hurt, Sep 24 2017
MATHEMATICA
Riffle[Range[60], 0, 3] (* Harvey P. Dale, Sep 12 2013 *)
PROG
(Magma) I:=[1, 2, 0, 3, 4, 0]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..91]]; // G. C. Greubel, Oct 21 2021
(Sage)
def a(n): return (2*n+3)/3 if (n%3==0) else 2*(n+2)/3 if (n%3==1) else 0
[a(n) for n in (0..90)] # G. C. Greubel, Oct 21 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Apr 01 2006
STATUS
approved