%N Given a list of ternary numbers, interpret each as a ternary Gray code number, then convert to decimal.
%C Ternary numbers are converted into ternary Gray code by using the following algorithm: Leftmost term is leftmost Gray code term. Then going to the right, if next term b is greater than current term a, then (b - a) is the next Gray code term. (Gray code terms do not enter into the algorithmic operation). If next term b < a, then add 3 to b and perform [(3+b) - a] which becomes the next Gray code term. If b = a, the Gray code term = 0.
%C Interpreting any N-Ary code for n as N-Ary Gray code or vice versa results in a permutation of the natural numbers. Any N-Ary term can be converted to the N-Ary Gray code by using a generalization of the algorithmic rules such that if b < a, then add N to b and perform [(N + b) - a]. The other rules remain the same. A105530: ternary Gray code interpreted as ternary.
%e a(9) = 13 since Ternary 100 (9 decimal) interpreted as Ternary Gray code = 13.
%Y Cf. A105530, A003188.
%A _Gary W. Adamson_, Apr 11 2005
%E More terms from _Sean A. Irvine_, Feb 09 2012