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 A061282 #33 Mar 24 2017 00:47:50 %S A061282 0,1,2,2,3,4,3,4,5,3,4,5,4,5,6,5,6,7,4,5,6,5,6,7,6,7,8,4,5,6,5,6,7,6, %T A061282 7,8,5,6,7,6,7,8,7,8,9,6,7,8,7,8,9,8,9,10,5,6,7,6,7,8,7,8,9,6,7,8,7,8, %U A061282 9,8,9,10,7,8,9,8,9,10,9,10,11,5,6,7,6,7,8,7,8,9,6,7,8,7,8,9,8,9,10,7,8 %N A061282 Minimal number of steps to get from 0 to n by (a) adding 1 or (b) multiplying by 3. A stopping problem: begin with n and at each stage if a multiple of 3 divide by 3, otherwise subtract 1. %C A061282 n > 0 occurs A001590(n+2) times in this sequence. - _Peter Kagey_, Jul 19 2015 %C A061282 a(n) gives the number of iterations of A260316 to reach 0. - _Peter Kagey_, Jul 22 2015 %H A061282 Alois P. Heinz, <a href="/A061282/b061282.txt">Table of n, a(n) for n = 0..10000</a> %H A061282 <a href="/index/Com#complexity">Index to sequences related to the complexity of n</a> %F A061282 a(n) = A062153(n) + A053735(n) = (number of base 3 digits of n) + (sum of base 3 digits of n)-1. a(3n) = a(n)+1, a(3n+1) = a(n)+2, a(3n+2) = a(n)+3; a(0)=0, a(1)=1, a(2)=2. %e A061282 a(25)=7 since 25=((0+1+1)*3+1+1)*3+1. %p A061282 a:= n-> (l-> nops(l)+add(i, i=l)-1)(convert(n, base, 3)): %p A061282 seq(a(n), n=0..105); # _Alois P. Heinz_, Jul 16 2015 %o A061282 (PARI) a(n)=sumdigits(n,3)+#digits(n,3)-1 \\ _Charles R Greathouse IV_, Jul 16 2015 %o A061282 (Haskell) %o A061282 c i = if i `mod` 3 == 0 then i `div` 3 else i - 1 %o A061282 b 0 foldCount = foldCount %o A061282 b sheetCount foldCount = b (c sheetCount) (foldCount + 1) %o A061282 a061282 n = b n 0 -- _Peter Kagey_, Sep 02 2015 %Y A061282 Cf. A001590, A007089, A053735, A056792, A062153, A260316. %Y A061282 Analogous sequences with a different multiplier k: A056792 (k=2), A260112 (k=4). %K A061282 nonn,easy %O A061282 0,3 %A A061282 _Henry Bottomley_, Jun 06 2001