Arbitrary cycle of digits in rational number?

Hello all, I have recently been wondering whether there is a way to determine a fraction for which the decimal expansion is a cycle of n numbers?

I would like to be able to work this out myself, but I can't wait until I start my mathematics degree. So any help would be greatly appreciated.

For example, if I wanted a rational number with a repeated 500 digit sequence, is there a way to efficiently work out an example of such a number?

Penny for your thoughts guys.

If n is a primitive root of 10 then the cycle of 1/n is n-1 digits long.

For example 1/7=.142857142857... has 6 repeating digits.
Start with a repeating decimal like, for example, 0.123412341234... Try multiplying it by an appropriate power of ten, and then subtracting the original number.

In this example you started with a repeating decimal; try to run the exercise backwards, to see if you can end up obtaining a repeating decimal.
Ah thanks guys, I feel stupid for having to ask now :).

The Physics Forums Way

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving