%I #14 Mar 30 2017 21:52:55
%S 0,1,3,8,20,49,123,319,849,2294,6250,17112,47013,129605,358838,998805,
%T 2796093,7869800,22251147,63141639,179701239,512744599,1466635089,
%U 4205423895,12087339723,34816804310,100469592521,290336059740,839932833290,2432050970420,7047731703137,20440131344750,59334695322383,172409162871823,501489513690423,1460214792034791
%N a(n) = number of steps to reach 0 when starting from k = (3^n)-1 and repeatedly applying the map that replaces k with k - (sum of digits in base-3 representation of k).
%F a(0) = 0; for n >= 1, a(n) = A261234(n-1) + a(n-1).
%F a(n) = A261231((3^n)-1).
%F a(n) = A261232(n)-1.
%o (Scheme, two variants)
%o (definec (A261233 n) (if (zero? n) n (+ (A261234 (- n 1)) (A261233 (- n 1)))))
%o (define (A261233 n) (A261231 (- (A000244 n) 1)))
%Y One less than A261232.
%Y Cf. A000244, A261231.
%Y Cf. A261234 (the first differences).
%Y Cf. also A218600.
%K nonn
%O 0,3
%A _Antti Karttunen_, Aug 13 2015
%E Terms from a(24) onward added from the output of _Hiroaki Yamanouchi_'s program by _Antti Karttunen_, Aug 16 2015