# Closed-form decimal to binary

I've searched around but can't seem to find anything relevant. Given a natural number $n$, is there a closed-form formula that gives a decimal number (whose digits consist only of ones and zeros) which, when interpreted as a bit string, equals $n$? What about the reverse?

-
This gives an algorithm, but not a "closed-form formula". –  Srivatsan Sep 13 '11 at 1:19
Are you asking if it's possible to convert a natural number to binary? –  mixedmath Sep 13 '11 at 1:20
@mixedmath: No, I'm asking if there's an expression for the function {(0, 0), (1, 1), (2, 10), (3, 11), ...}. It's got an interesting graph and I was curious if there were some clever formula in terms of logarithm and modulus. –  Jon Purdy Sep 13 '11 at 1:25
OEIS has some suggestions for formulas, none particularly pretty. –  Henning Makholm Sep 13 '11 at 1:45