0,1

a(A134026(n)) < A134026(n);

a(A003462(n)) = A003462(n);

a(A134025(n)) >= A134025(n).

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

a(n) = if n<3 then 2 - n else 3*a(floor(n/3)) + 2 - n mod 3.

(PARI) a(n) = 3^(if(n, logint(n, 3))+1) - 1 - n; \\ Kevin Ryde, Jul 16 2020

Cf. A007089, A035327, A061601.

Sequence in context: A113368 A066435 A261301 * A330396 A182376 A030206

Adjacent sequences: A171957 A171958 A171959 * A171961 A171962 A171963

nonn

Reinhard Zumkeller, Jan 20 2010

approved