%I #5 Mar 30 2012 18:51:33
%S 0,2,1,1,0,2,2,1,0,2,1,0,0,2,1,1,0,2,1,0,2,2,1,0,0,2,1,1,0,2,2,1,0,0,
%T 2,1,0,2,1,1,0,2,2,1,0,2,1,0,0,2,1,1,0,2,2,1,0,0,2,1,1,0,2,1,0,2,2,1,
%U 0,0,2,1,0,2,1,1,0,2,2,1,0,2,1,0,0,2,1,1,0,2,1,0,2,2,1,0,0,2,1,0,2,1,1,0,2
%N If the final digit of n in base 3 is the same as a([n/3]) then this digit, otherwise a(n)= mod 3-sum of these two digits, with a(0)=0.
%H <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a>
%F a(n) =(-a([n/3])-n) mod 3 =A060583(n) mod 3.
%e a(4)=0 since a([4/3])=a(1)=2, (4 mod 3)=1 and 3-2-1=0. a(5)=2 since a([5/3])=a(1)=2 and (5 mod 3)=2.
%Y Cf. A060588.
%K base,nonn
%O 0,2
%A _Henry Bottomley_, Apr 04 2001