Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I go about finding numbers x such that x and 1/x are finitely decimally reciprocal and are also close to 1?

I'm not entirely certain how to phrase this question, but take for example 2. 2 and 1/2 can be represented with a finite number of decimal points.

The closest pair to 1 that I have found is 4/5 and 5/4. Are there closer pairs and how would I look for them?

share|cite|improve this question
Note that you can make them as close to $1$ as you like. This is because the irrational number $\ln 2/\ln 5$ can be approximated by rational fractions to any desired degree of accuracy. – NotNotLogical May 4 '14 at 19:34
up vote 26 down vote accepted

The only rational numbers that have finite decimal representations are those whose denominator has only $2$ and $5$ as its prime factors. (because if $z$ has a finite decimal expansion, then $y=10^k z$ is an integer for some positive integer $k$, and thus $z = y/10^k$)

Thus, the pairs you are looking for are all of the form $2^m / 5^n$ and $5^n / 2^m$.

To see when they're close to 1, it's easier to turn it into an additive problem by taking logarithms: you want

$$ m \ln 2 - n \ln 5 \sim 0 $$

Rearranging, we want

$$ \frac{m}{n} \sim \frac{\ln 5}{\ln 2} $$

so the problem is to find very good rational approximations to $\ln 5 / \ln 2$.

The first few approximations given by continued fractions is:

  • $m/n = 2$, and thus $x = 4/5 = 0.8$
  • $m/n = 7/3$, and thus $x = 2^7 / 5^3 = 1.024$ and $1/x = 0.9765625$
  • $m/n = 65/28$, and thus $x = 2^{65}/5^{28} = 0.99035\ldots$
share|cite|improve this answer
Can you justify your first sentence? Also, is a number like $2^{m_1}5^{m_2}/2^{n_1}5^{n_2}$ also possible? – user103828 May 5 '14 at 9:03
Yes, but you can cancel things out. e.g. $8/10$ works, but it's the same number as $4/5$. – Hurkyl May 5 '14 at 10:18
The number could also be of the form $2^m 5^n$, $5^m / 2^m$, or $1 / (2^m 5^m)$. The first and the third options are not close to $1$. But I think the second option should be included. – 6005 May 5 '14 at 18:48
@Goos: Remember we're looking for a pair ($x$, $1/x$); if $x=5^m/2^n$, then $1/x$ is of the form my post is looking for. However, I've been wondering if continued fractions would find a different set of approximations for $\ln 2 / \ln 5$, but not enough to grind through the algebra to see. – Hurkyl May 5 '14 at 20:27
@Hurkyl If $r > 1$, then to find the continued fraction for $r$ you first write $r = \frac{1}{1/r}$, and then you find a continued fraction for $1/r$. So the approximations to $\ln 2 / \ln 5$ and $\ln 5 / \ln 2$ are reciprocals of each other. There is also a definition of continued fraction approximation that makes this symmetry clear--good approximations $m/n$ are ordered pairs $(m,n)$ in the the plane that are close to the angle of the real number $r$ in some sense, and the plane is symmetric about $y = x$. – 6005 May 6 '14 at 1:03

What you need is a power of $2$ and a power of $5$ which are close together. Your example has $4=2^2$ and $5=5^1$.

Since powers of $2$ are a multiple of $2$ apart, you can always get between $\frac 12$ and $2$.

To get the best results, though, we want $5^n=k2^m$ where $k$ is close to $1$.

Taking logs we have $n\log 5 = \log k + m\log 2$ and since $k$ is near to $1$ we have $\log k$ close to zero, and we see that $$\frac nm\approx\frac{\log 2}{\log 5}$$ and the best way of getting close is to use the continued fraction expansion of $\frac{\log 2}{\log 5}$.

share|cite|improve this answer

As an "extended" comment, adding to the above posts, we have $$\frac{\ln 2}{\ln 5}\approx 0.43067655807339306$$

The first few "best approximations" for that decimal are (research the Stern-Brocot Tree) $$[(2, 5, 0.4), (3, 7, 0.42857142857142855), (34, 79, 0.43037974683544306), (31, 72, 0.4305555555555556), (205, 476, 0.43067226890756305), (497, 1154, 0.4306759098786828), (643, 1493, 0.4306764902880107), (4647, 10790, 0.4306765523632993), (21306, 49471, 0.43067655798346505), (21306, 49471, 0.43067655798346505), (97879, 227268, 0.4306765580724079), (1740516, 4041353, 0.4306765580734967), (2034153, 4723157, 0.4306765580733395), (1936274, 4495889, 0.4306765580733866), (15392313, 35739844, 0.43067655807339283), (59632978, 138463487, 0.430676558073393)]$$ where the pairs are $(m,n,\text{decimal})$ for $5^m,2^n$.

And I broke my computer trying to compute the last decimal, so I'll be back with the outputs of those numbers...

Some results are $${5^{205}\over 2^{476}}=0.9967194951\dots$$ and $${5^{59632978}\over 2^{138463487}}=0.9999999850988389 \dots$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.