%I #42 Dec 27 2023 11:53:41
%S 0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,
%T 0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,
%U 1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1
%N Decimal expansion of 1/999.
%C Expansion in any base b of 1/(b^3-1). E.g., 1/7 in base 2, 1/26 in base 3, 1/63 in base 4, etc. - _Franklin T. Adams-Watters_, Nov 07 2006
%C a(n) = A130196(n) - A131534(n). - _Reinhard Zumkeller_, Nov 12 2009
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 1).
%F From Mario Catalani (mario.catalani(AT)unito.it), Jan 07 2003: (Start)
%F G.f.: x^2/(1-x^3).
%F a(n) = -(1/2)*((-1)^floor((2n-1)/3) + (-1)^floor((2n+1)/3)). (End)
%F From _Hieronymus Fischer_, May 29 2007: (Start)
%F a(n) = ((n+2) mod 3) mod 2.
%F a(n) = (1/2)*(1 - (-1)^(n + floor((n+2)/3))). (End)
%F a(n) = (1 + (-1)^Fibonacci(n+1))/2. - _Hieronymus Fischer_, Jun 14 2007
%F a(n) = (n^5 - n^2) mod 3. - _Gary Detlefs_, Mar 20 2010
%F a(n) = ((-1)^(a(n-1) + a(n-2)) + 1)/2 starting from n=3. - _Adriano Caroli_, Nov 21 2010
%F a(n) = 1 - Fibonacci(n+1) mod 2. - _Gary Detlefs_, Dec 26 2010
%F a(n) = floor((n+1)/3) - floor(n/3). - _Tani Akinari_, Oct 22 2012
%e 0.001001001001001001001...
%t Join[{0,0},RealDigits[1/999,10,120][[1]]] (* or *) PadRight[{},120,{0,0,1}] (* _Harvey P. Dale_, May 24 2012 *)
%o (PARI) a(n)=n%3==2 \\ _Jaume Oliver Lafont_, Mar 24 2009
%Y Essentially the same as A079978.
%Y Cf. A068601.
%Y Partial sums are given by A002264(n+1).
%K nonn,cons
%O 0,1
%A _N. J. A. Sloane_