login
a(n) = min(n, A004488(n)), where A004488(n) is base-3 sum n+n without carries.
6

%I #7 Jan 11 2020 21:50:11

%S 0,1,1,3,4,5,3,5,4,9,10,11,12,13,14,15,16,17,9,11,10,15,17,16,12,14,

%T 13,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,

%U 49,50,51,52,53,27,29,28,33,35,34,30,32,31,45,47,46,51,53,52,48,50,49,36,38,37,42,44,43,39,41,40,81

%N a(n) = min(n, A004488(n)), where A004488(n) is base-3 sum n+n without carries.

%C After the initial zero, sequence contains only terms of A132141, each appearing exactly twice.

%H Antti Karttunen, <a href="/A330740/b330740.txt">Table of n, a(n) for n = 0..59048</a>

%F a(n) = min(n, A004488(n)).

%o (PARI) A330740(n) = min(n,subst(Pol(apply(x->(3-x)%3, digits(n, 3)), 'x), 'x, 3));

%Y Cf. A004488, A132141.

%Y Central diagonal of A325825 (after the initial zero).

%K nonn,base

%O 0,4

%A _Antti Karttunen_, Jan 11 2020