SHOULDA wrote: At minimum, (c74) block([keepfloat:true],linsolve((2*integer+1)/(5*integer+3)=0.3985))
(d74) [integer = 26.066]
(c75) subst(ceiling(%),5*integer+3)
(d75) 138 Serves me right for not using continued fractions. at bats.
ok, that looks better. but how do you get the form (2n + 1) / (5n + 3) ? is there some way without continued fractions? btw, the c.f. method i described before can be cleaned up slightly. to find the "simplest" rational number in the closed interval [a, b] , compute the convergents for the cf's of a and b . suppose p/q and P/Q are the last two they have in common. then the next convergent for each will be of the form (p + Pn) / (q + Qn) for some positive integer n . if the simpler of these two is in the target interval, then that's the one. otherwise, replace n by n+1 in its expression as above, and that gives the simplest fraction in the interval. (this may require a and b to be positive, but it's easy to reduce to that case.) mike