This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A261234 #43 Mar 30 2017 21:52:34 %S A261234 1,2,5,12,29,74,196,530,1445,3956,10862,29901,82592,229233,639967, %T A261234 1797288,5073707,14381347,40890492,116559600,333043360,953890490, %U A261234 2738788806,7881915828,22729464587,65652788211,189866467219,549596773550,1592118137130,4615680732717,13392399641613,38894563977633,113074467549440,329080350818600,958725278344368,2795854777347489 %N A261234 a(n) = number of steps to reach (3^n)-1 when starting from k = (3^(n+1))-1 and repeatedly applying the map that replaces k with k - (sum of digits in base-3 representation of k). %H A261234 Hiroaki Yamanouchi, <a href="/A261234/b261234.txt">Table of n, a(n) for n = 0..100</a> %H A261234 Antti Karttunen, <a href="/A261234/a261234_4.c.txt">Naive C-program for computing the terms of A261234, A261236 and A261237 at the same time</a> %H A261234 Hiroaki Yamanouchi, <a href="/A261234/a261234.py.txt">Fast Python-program for computing terms of A213709, A261234 and analogous sequences in other bases</a> %F A261234 a(n) = A261236(n) + A261237(n). %t A261234 Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, 3] &, 3^(n + 1) - 1, # > 3^n - 1 &] - 1, {n, 0, 16}] (* _Michael De Vlieger_, Jun 27 2016 *) %o A261234 (Scheme, three variants) %o A261234 (definec (A261234 n) (let ((end (- (A000244 n) 1))) (let loop ((k (- (A000244 (+ 1 n)) 1)) (s 0)) (if (= k end) s (loop (* 2 (A054861 k)) (+ 1 s)))))) %o A261234 (define (A261234 n) (- (A261233 (+ 1 n)) (A261233 n))) %o A261234 (define (A261234 n) (- (A261231 (A000244 (+ 1 n))) (A261231 (A000244 n)))) %Y A261234 Cf. A000244, A054861, A261231, A261230. %Y A261234 First differences of A261232 and A261233. %Y A261234 Sum of A261236 and A261237. %Y A261234 Cf. A261235 (first differences of this sequence). %Y A261234 Cf. also A213709. %K A261234 nonn,base %O A261234 0,2 %A A261234 _Antti Karttunen_, Aug 13 2015 %E A261234 a(23)-a(35) from _Hiroaki Yamanouchi_, Aug 16 2015