A061339 Minimal number of steps to get from 0 to n by (a) adding 1 or (b) subtracting 1 or (c) multiplying by 2.
0, 1, 2, 3, 3, 4, 4, 5, 4, 5, 5, 6, 5, 6, 6, 6, 5, 6, 6, 7, 6, 7, 7, 7, 6, 7, 7, 8, 7, 8, 7, 7, 6, 7, 7, 8, 7, 8, 8, 8, 7, 8, 8, 9, 8, 9, 8, 8, 7, 8, 8, 9, 8, 9, 9, 9, 8, 9, 9, 9, 8, 9, 8, 8, 7, 8, 8, 9, 8, 9, 9, 9, 8, 9, 9, 10, 9, 10, 9, 9, 8, 9, 9, 10, 9, 10, 10, 10, 9, 10, 10, 10, 9, 10, 9, 9, 8, 9, 9
Offset: 0
Keywords
Examples
a(23)=7 since 23=(0+1+1+1)*2*2*2-1.
Crossrefs
Cf. A056792.
Formula
a(2n)=a(n)+1; a(2n+1)=min{a(n)+2, a(n+1)+2}; a(0)=0, a(1)=1.