Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #15 Aug 18 2024 15:07:19
%S 0,1,2,4,4,6,8,9,9,10,11,13,13,15,17,18,18,19,20,22,22,24,26,27,27,28,
%T 29,31,31,33,35,36,36,37,38,40,40,42,44,45,45,46,47,49,49,51,53,54,54,
%U 55,56,58,58,60,62,63,63,64,65,67,67,69,71,72,72,73,74,76,76,78,80,81,81,82,83,85,85,87,89
%N Partial sums of (Fibonacci numbers mod 3).
%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1, 0, 0, 0, 0, 0, 0, 1, -1).
%F 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]
%e 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, ...
%t 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 *)
%o (JavaScript)
%o N=50;
%o f=new Array();
%o f[0]=0; f[1]=1;
%o for (i=2;i<N;i++) f[i]=f[i-1]+f[i-2];
%o fs=0;
%o for (i=0;i<N;i++) { fs+=f[i]%3; document.write(fs+', '); }
%o (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
%Y Cf. A000045, A082115.
%K nonn
%O 0,3
%A _Jon Perry_, Sep 15 2013