show/hide this revision's text 2 added 265 characters in body

Taking the continued fraction approximations of your decimal expansion until the denominators get larger than 10^N ought to work.

Edit: Let me add that you have to do a tiny bit more work to get the best rational approximants from the continued fraction, and that's probably the algorithm that should be used. See http://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations

    Post Undeleted by jc
    Post Deleted by jc
show/hide this revision's text 1