Show that rational numbers correspond to decimals which are either repeating or terminating.

Hint: If q = m|n, then when dividing m by n to put q into decimal form there are at most n different remainders. Conversley, if d is a repeating decimal, then find s,t such that 10^sd - 10^td is an integer.

I took an example and understand, but don't know how to write it in a general form.

My example:

Part I

2/7

0.2857142...

7√2.000...

-14

60

-56

40

-35

50

-49

10

- 7

30

-28

20

-14

6....

So the my bold numbers can only be 1-6

Part II

R = 12.34545...

100R = 1234.54545...

100R - R = 1222.2

99R = (12222 / 10)

R = (12222 / 990)

Any help on writing this in a general form would be greatly appreciated.