Preferred number
The idea here is to get a smooth logarithmic division of each order of magnitude (power of 10). To get x steps that perfectly divide the order of magnitude, just use the xth root of 10 as your factor. In Ruby:    def series(x, precision=2)
      root = 10 ** (1 / x.to_f)
      return x.times.map {|i| (root ** i).round(precision)}
    end

    > series(2)
    => [1.0, 3.16]
    > series(5)
    => [1.0, 1.58, 2.51, 3.98, 6.31]
    > series(10)
    => [1.0, 1.26, 1.58, 2.0, 2.51, 3.16, 3.98, 5.01, 6.31, 7.94]

And of course, if you want more aesthetically pleasing increments (like for axis markers on a logarithmic graph), just round each increment as desired. I usually find that the [1, 2, 5] series is sufficient.