2

Say I have a sequence (s) of digits written as number. (Ex: 1234567890) I need to find out shortest possible pair of numerator (n) and denominator (d) that ,being converted to decimal form of fraction (r), starts with that sequence after a decimal point. What would be the formula for finding n and d through s.

Example: let s=123, the r may be 0.123456, 0.1234444, 2.123456, etc. r = n/d, find a pair of least n and d of all possible r in form ... .123 ...

Thanks!

  • If there is a nice algorithm, it may be related to continued fractions. If you just want a handful of specific cases, things like http://www.wolframalpha.com/input/?i=Rationalize%5B0.1234444%2C.0000001%5D might work for you. – Mark S. May 31 '15 at 21:51

0 Answers0