Could also be described as "Write n in base 3, then replace each digit by its base 3 negative" as with A048647 for base 4 - Henry Bottomley (se16(AT)btinternet.com), Apr 19 2000
a(a(n)) = n, a self-inverse permutation of natural numbers. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 19 2003