title: Natural Binary Code - finding first n numbers
body: <p>Outputting/finding first n numbers of Natural Binary Code:</p>
  
  <pre><code>import math  
  def binary_print(n):
      m = int(math.ceil(math.log(n, 2)))
      for i in range(n):
          b = str(bin(i)[2:])
          print((m - len(b)) * '0' + b)
  </code></pre>
  
  <p>My question is:</p>
  
  <p>Do you know any other way to do this in Python? Maybe faster? Or shorter (less code)?</p>