%I #50 Aug 05 2024 05:17:14
%S 0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,
%T 2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,
%U 1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1
%N Decimal expansion of 1/819.
%C Partial sums of A010892. - _Paul Barry_, Jun 06 2003
%C Expansion in any base b >= 3 of 1/((b-1)*(b^2-b+1)) = 1/(b^3-2b^2+2b-1). E.g., 1/14 in base 3, 1/39 in base 4, 1/84 in base 5, etc. - _Franklin T. Adams-Watters_, Nov 07 2006
%C a(n) is the second least significant digit in the ternary representation of 2^n (cf. A004642). - _Alexandre Herrera_, Oct 09 2023
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,1).
%F a(n) = a(n-1)-a(n-2)+1 = 2-a(n-3) = a(n-6). - _Henry Bottomley_, Apr 12 2000
%F a(n) = Sum_{k=1..floor(n/2)} (-1)^(k+1)*binomial(n-k, k) = 1-((-1)^floor(n/3)+(-1)^(floor((n+1)/3)))/2. - _Vladeta Jovovic_, Feb 10 2003
%F G.f.: x^2/(1-2x+2x^2-x^3)=x^2/((1-x)(x^2-x+1)). - _Paul Barry_, Jun 06 2003
%F a(n+2) = sum{k=0..n, binomial(n-2k, n-k)}. - _Paul Barry_, Jan 15 2005
%F a(0)=0, a(1)=0, a(2)=1, a(n)=2*a(n-1)-2*a(n-2)+a(n-3). - _Harvey P. Dale_, Aug 19 2012
%e 0.0012210012210012210...
%t Join[{0,0},RealDigits[1/819,10,120][[1]]] (* or *) PadRight[{},120,{0,0,1,2,2,1}] (* or *) LinearRecurrence[{2,-2,1},{0,0,1},120] (* _Harvey P. Dale_, Aug 19 2012 *)
%o (PARI) a(n)=1/819. \\ _Charles R Greathouse IV_, Sep 24 2015
%Y Cf. A077859, A027444.
%Y Cf. A004642, A153130 (2^n mod 9).
%K nonn,cons,easy
%O 0,4
%A _N. J. A. Sloane_