%I #16 Oct 05 2019 18:22:22
%S 1,3,9,2,6,18,4,12,36,108,27,81,20,5,15,45,11,33,8,24,72,216,54,13,39,
%T 117,29,7,21,63,189,47,141,35,105,26,78,19,57,14,42,10,30,90,22,66,16,
%U 48,144,432,1296,324,972,243,60,180,540,135
%N a(n) = floor(a(n-1)/4) if this is not among 0, a(1), ..., a(n-2); otherwise a(n) = 3*a(n-1).
%H Ivan Neretin, <a href="/A050104/b050104.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Digit.html">Digit.</a>
%t Rest@Nest[Append[#, If[FreeQ[#, r = Quotient[#[[-1]], 4]], r, 3 #[[-1]]]] &, {0, 1}, 57] (* _Ivan Neretin_, Jul 31 2016 *)
%Y Cf. A050000 and references therein.
%K nonn
%O 1,2
%A _Clark Kimberling_