(1/2)*Sum{|d(i)-e(i)|} where Sum{d(i)*3^i} is base 3 representation of n and e(i) are digits d(i) in nondecreasing order.

A037880

(1/2)*Sum{|d(i)-e(i)|} where Sum{d(i)*3^i} is base 3 representation of n and e(i) are digits d(i) in nondecreasing order.

Terms

    a(0) =0a(1) =0a(2) =0a(3) =0a(4) =1a(5) =0a(6) =0a(7) =0a(8) =0a(9) =1a(10) =2a(11) =0a(12) =0a(13) =1a(14) =1a(15) =1a(16) =1a(17) =0a(18) =1a(19) =2a(20) =0a(21) =0a(22) =1a(23) =0a(24) =0a(25) =0a(26) =0a(27) =1a(28) =2a(29) =1

External references