OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 0, 0, 1, -1).
FORMULA
G.f.: (x+x^2+2*x^3+2*x^5+2*x^6+x^7)/((1-x^8)*(1-x)). [Joerg Arndt, Sep 15 2013]
EXAMPLE
The first F(n) are 0, 1, 1, 2, 3, 5, 8,... mod 3 this becomes 0, 1, 1, 2, 0, 2, 2,... so a(n) starts 0, 1, 2, 4 ,4, 6, 8, ...
MATHEMATICA
Accumulate[Mod[Fibonacci[Range[0, 80]], 3]] (* or *) LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 4, 4, 6, 8, 9, 9}, 80] (* Harvey P. Dale, Aug 18 2024 *)
PROG
(JavaScript)
N=50;
f=new Array();
f[0]=0; f[1]=1;
for (i=2; i<N; i++) f[i]=f[i-1]+f[i-2];
fs=0;
for (i=0; i<N; i++) { fs+=f[i]%3; document.write(fs+', '); }
(PARI) concat([0], Vec( (x+x^2+2*x^3+2*x^5+2*x^6+x^7)/((1-x^8)*(1-x)) + O(x^166) ) ) \\ Joerg Arndt, Sep 15 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Sep 15 2013
STATUS
approved