We know $\frac{1}{81}$ gives us $0.\overline{0123456790}$
How do we create a recurrent decimal with the property of repeating:
$0.\overline{0123456789}$
a) Is there a method to construct such a number?
b) Is there a solution?
c) Is the solution in $\mathbb{Q}$?
According with this Wikipedia page: http://en.wikipedia.org/wiki/Decimal One could get this number by applying this series. Supppose:
$M=123456789$, $x=10^{10}$, then $0.\overline{0123456789}= \frac{M}{x}\cdot$ $\sum$ ${(10^{-9})}^k$ $=\frac{M}{x}\cdot\frac{1}{1-10^{-9}}$ $=\frac{M}{9999999990}$
Unless my calculator is crazy, this is giving me $0.012345679$, not the expected number. Although the example of wikipedia works fine with $0.\overline{123}$.
Some help I got from mathoverflow site was that the equation is: $\frac{M}{1-10^{-10}}$. Well, that does not work either.
So, just to get rid of the gnome calculator rounding problem, running a simple program written in C with very large precision (long double) I get this result:
#include <stdio.h>
int main(void)
{
long double b;
b=123456789.0/9999999990.0;
printf("%.40Lf\n", b);
}
Result: $0.0123456789123456787266031042804570461158$
Maybe it is still a matter of rounding problem, but I doubt that...
Please someone?
Thanks!
Beco
Edited:
Thanks for the answers. After understanding the problem I realize that long double is not sufficient. (float is 7 digits:32 bits, double is 15 digits:64 bits and long double is 19 digits:80 bits - although the compiler align the memory to 128 bits)
Using the wrong program above I should get $0.0\overline{123456789}$ instead of $0.\overline{0123456789}$. Using the denominator as $9999999999$ I must get the correct answer. So I tried to teach my computer how to divide:
#include <stdio.h>
int main(void)
{
int i;
long int n, d, q, r;
n=123456789;
d=9999999999;
printf("0,");
n*=10;
while(i<100)
{
if(n<d)
{
n*=10;
printf("0");
i++;
continue;
}
q=n/d;
r=n%d;
printf("%ld", q);
if(!r)
break;
n=n-q*d;
n*=10;
i++;
}
printf("\n");
}
while(i<PREC)
. Output with 100: 0,0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 – DrBeco Mar 29 '11 at 04:07