OFFSET
0,3
COMMENTS
n > 0 occurs A001590(n+2) times in this sequence. - Peter Kagey, Jul 19 2015
a(n) gives the number of iterations of A260316 to reach 0. - Peter Kagey, Jul 22 2015
LINKS
FORMULA
EXAMPLE
a(25)=7 since 25=((0+1+1)*3+1+1)*3+1.
MAPLE
a:= n-> (l-> nops(l)+add(i, i=l)-1)(convert(n, base, 3)):
seq(a(n), n=0..105); # Alois P. Heinz, Jul 16 2015
PROG
(PARI) a(n)=sumdigits(n, 3)+#digits(n, 3)-1 \\ Charles R Greathouse IV, Jul 16 2015
(Haskell)
c i = if i `mod` 3 == 0 then i `div` 3 else i - 1
b 0 foldCount = foldCount
b sheetCount foldCount = b (c sheetCount) (foldCount + 1)
a061282 n = b n 0 -- Peter Kagey, Sep 02 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jun 06 2001
STATUS
approved