OFFSET
0,5
COMMENTS
If n is a multiple of 3, then a(n) = 0, and if n is of the form 3k+r, with r = 1 or 2, then a(n) = 2*k + 1. - Antti Karttunen, Apr 14 2022
REFERENCES
Maria Paola Bonacina and Nachum Dershowitz, Canonical Inference for Implicational Systems, in Automated Reasoning, Lecture Notes in Computer Science, Volume 5195/2008, Springer-Verlag.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
G.f.: x*(1+x+x^3+x^4)/(1-2*x^3+x^6).
a(n) = (2/3)*floor((2*n+1)/3)*(1-cos(2*Pi*n/3)).
From M. F. Hasler, Dec 13 2007: (Start)
a(n) = |A120691(n+1)| for n>0.
a(n) = ([n/3]*2 + 1)*dist(n,3Z). (End)
a(n) = 2*sin(n*Pi/3)*(4*n*sin(n*Pi/3)-sqrt(3)*cos(n*Pi))/9. - Wesley Ivan Hurt, Sep 24 2017
a(n) = 2*a(n-3) - a(n-6), for n > 5. - Chai Wah Wu, Jul 27 2022
MATHEMATICA
LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 1, 1, 0, 3, 3}, 90] (* G. C. Greubel, Dec 09 2022 *)
PROG
(PARI) A102899(n)=(n\3*2+1)*(0<n%3) \\ M. F. Hasler, Dec 13 2007
(Magma) I:=[0, 1, 1, 0, 3, 3]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..91]]; // G. C. Greubel, Dec 09 2022
(SageMath)
def A102899(n): return (1+2*(n//3))*((n%3)>0)
[A102899(n) for n in range(91)] # G. C. Greubel, Dec 09 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Jan 17 2005
STATUS
approved