Cyclic Number Calculator

Fraction and decimal

Repeating digits of 1/7142 857
Period length6
Full reptend prime?Yes - the period equals d - 1
Next full-reptend prime after 717
How this was calculated
  1. Dividing 1 by d gives a repeating decimal; when the period has the maximum possible length d - 1, d is a full reptend prime and its repetend is called a cyclic number.
  2. Long division gives 1/7 = 0.(142 857), a period of 6 digits.
  3. Doubling the repetend gives 285 714, which is one of its rotations - the signature of a cyclic number, whose multiples cycle the same digits.
  4. The next full-reptend prime after 7 is 17.

This cyclic number calculator shows you the repeating decimal of a fraction and tells you whether its denominator is a full reptend prime — a prime whose period equals the prime minus one. The repeating digits of 1/7 are 142857, a period of 6 digits, and 7 is a full reptend prime because the period equals 7 - 1; the multiples 2/7 through 6/7 are rotations of the same digits, and 142857 x 7 = 999999. Not every prime qualifies: the repeating digits of 1/13 are 076923, a period of 6 digits, but 13 is not a full reptend prime because the period is shorter than 13 - 1 = 12, and the next full-reptend prime after 13 is 17. The repeating digits of 1/17 are 0588235294117647, a period of 16 digits, and 17 is a full reptend prime; the next full-reptend prime after 17 is 19. The tool also flags denominators that share a factor with 10 (a factor 2 or 5), which have a non-repeating head before the cycle begins.

The calculator applies the standard long-division method for converting a fraction to a repeating decimal, so its period and full-reptend results follow the accepted definition rather than a shortcut. This page shows the formula, step-by-step workings, worked examples and sources, so you can check each result yourself and see exactly where the cycle starts and ends.

Worked examples

1/7 - the classic cyclic number

(7)

Repeating digits of 1/7142 857
Period length6
Full reptend prime?Yes - the period equals d - 1
Next full-reptend prime after 717

1/13 - a six-digit cycle, but not full length

(13)

Repeating digits of 1/13076 923
Period length6
Full reptend prime?No - the period is shorter than d - 1
Next full-reptend prime after 1317

1/17 - a full-reptend prime

(17)

Repeating digits of 1/17058 823 529 411 764 7
Period length16
Full reptend prime?Yes - the period equals d - 1
Next full-reptend prime after 1719

142857, the classic cyclic number

The number 142857 is the repeating block you get when you divide 1 by 7. Its digits repeat with a period of 6, and 7 earns a special label: it is a full reptend prime, because the period of its repeating digits equals 7 - 1. That single property is what makes a cyclic number calculator treat 142857 as the textbook example.

The striking part is what happens when you multiply 142857 by the whole numbers 1 through 6. The results are not new digit strings at all — they are rotations of the same six digits. Each multiple of 1/7 from 1/7 through 6/7 produces a repeating block that is 142857 with its digits cycled to a new starting point. The digits themselves never change, and no digit is added or lost.

The table below sets out those multiples side by side with their repeating blocks, followed by the seventh multiple, which breaks the pattern in a revealing way.

FractionRepeating block
1/7142857
2/7285714
3/7428571
4/7571428
5/7714285
6/7857142
142857 x 7 = 999999. The seventh multiple does not rotate the digits; it fills all six places with nines.

Full reptend primes

A full reptend prime is a prime whose reciprocal produces the longest repeating cycle that prime can have. For a prime p, that maximum period is p - 1 digits. When the repeating part of 1/p runs the full p - 1 digits, the prime is called full reptend, and its digits behave in a special way. A cyclic number calculator is built around exactly this property, because the rotation behavior that defines a cyclic number appears when the period is maximal.

The smallest example is 7. The repeating digits of 1/7 are 142857, a period of 6 digits. Since 6 equals 7 - 1, 7 is a full reptend prime. Its signature property is that the multiples 2/7 through 6/7 are rotations of the same digits. Another way to see the same structure: 142857 x 7 = 999999. The cycle of six digits, multiplied by the prime, fills out to a string of nines.

Not every prime with a long-looking decimal qualifies. The repeating digits of 1/13 are 076923, a period of 6 digits, but 13 is not a full reptend prime because the period is shorter than 13 - 1 = 12. The cycle stops well before the maximum. The next full-reptend prime after 13 is 17, which restores the maximal behavior.

The prime 17 has a period of 16 digits. The repeating digits of 1/17 are 0588235294117647, and 17 is a full reptend prime because 16 equals 17 - 1. The next full-reptend prime after 17 is 19. So the full reptend primes are not simply every prime in order; 13 is skipped, and the sequence moves from 7 to 17 to 19.

One more rule shapes what a calculator shows. Denominators that share a factor with 10, meaning a factor of 2 or 5, have a non-repeating head before the cycle begins. That head is why a decimal like 1/6 starts with digits that never return, followed by a repeating tail. Full reptend primes never have that problem, because a prime other than 2 or 5 shares no factor with 10, so its decimal is purely repeating from the first digit.

  • 7: period 6, equal to 7 - 1, so 7 is a full reptend prime.
  • 13: period 6, shorter than 13 - 1 = 12, so 13 is not a full reptend prime.
  • 17: period 16, equal to 17 - 1, so 17 is a full reptend prime.
  • The next full-reptend prime after 13 is 17; the next after 17 is 19.
Full reptend test: compare the period of 1/p with p - 1. If they match, p is a full reptend prime. For 7 the period is 6; for 17 it is 16; for 13 the period is 6, not 12.

When the period falls short

Most fractions with a denominator that is not 2 or 5 eventually repeat, but the length of the repeating block is not always the long one you might hope for. The period of 1/p does not have to equal p - 1. It only has to divide p - 1. A cyclic number calculator makes this visible: it reports the period it finds, and you can check that number against p - 1 to see whether the prime is full reptend or falls short.

The classic example is 1/7. Its repeating digits are 142857, a period of 6 digits. Because 6 equals 7 - 1, 7 is a full reptend prime, and the multiples 2/7 through 6/7 are rotations of the same digits. The same block also closes cleanly: 142857 x 7 = 999999. That is the behavior people mean when they call a repeating block cyclic.

Now compare 1/13. Its repeating digits are 076923, a period of 6 digits. Six is shorter than 13 - 1 = 12, so 13 is not a full reptend prime. The period still divides p - 1, since 6 divides 12, but it leaves half of the possible length unused. That is what the heading means by falling short: the decimal repeats, but the block is too short to generate all the nonzero multiples of 1/13 as rotations. If you enter 13 into a cyclic number calculator, the result is a period of 6, not 12.

The next full-reptend prime after 13 is 17. The repeating digits of 1/17 are 0588235294117647, a period of 16 digits, and 16 equals 17 - 1, so 17 qualifies. The next full-reptend prime after 17 is 19. This is why you cannot assume that every prime denominator produces a cyclic number just because it produces a repeating decimal.

One more wrinkle: denominators that share a factor with 10, meaning a factor of 2 or 5, have a non-repeating head before the cycle begins. The period rule above applies to the repeating part, not to the digits that come before it. So when you check a result, separate the non-repeating head from the cycle first, then compare the cycle length with p - 1.

  • 1/7: repeating digits 142857, period 6, and 6 = 7 - 1, so 7 is full reptend.
  • 1/13: repeating digits 076923, period 6, but 6 is shorter than 13 - 1 = 12, so 13 is not full reptend.
  • 1/17: repeating digits 0588235294117647, period 16, and 16 = 17 - 1, so 17 is full reptend.
  • The period always divides p - 1; a shorter period means the prime is not full reptend.
  • Denominators with a factor of 2 or 5 have a non-repeating head before the cycle.
A short period is not an error. For 1/13 the period is 6, and 6 divides 12, but it does not equal 12, so 13 is not a full reptend prime.

Heads before cycles

Not every fraction starts repeating right away. A cyclic number calculator has to account for a detail that trips people up: some denominators produce a short non-repeating run of digits — a "head" — before the repeating cycle begins. The rule is simple. Denominators that share a factor with 10 (a factor 2 or 5) have a non-repeating head before the cycle begins. Since 10 factors as 2 × 5, any denominator built partly from 2s or 5s will leave a stretch of digits at the start of the decimal that never comes back.

Contrast that with the clean cases. The repeating digits of 1/7 are 142857, a period of 6 digits. Seven is a full reptend prime because the period equals 7 - 1, and the multiples 2/7 through 6/7 are rotations of the same digits. There is no head at all — the six digits cycle from the very first decimal place. The same tidy behavior shows up in 142857 x 7 = 999999, the signature of a full reptend prime's period filling out a string of nines.

Full reptend status is not automatic for primes, though. The repeating digits of 1/13 are 076923, a period of 6 digits, but 13 is not a full reptend prime because the period is shorter than 13 - 1 = 12. The cycle still starts immediately — 13 has no factor of 2 or 5 — it is simply half as long as the maximum possible. The next full-reptend prime after 13 is 17, and its behavior is maximal: the repeating digits of 1/17 are 0588235294117647, a period of 16 digits, and 17 is a full reptend prime. After 17, the next full-reptend prime is 19.

So two separate questions decide what you see in the decimal. First, does the denominator share a factor with 10? If so, expect a non-repeating head before the cycle starts, and the calculator must strip that head off before it can identify the cycle. Second, once the cycle is isolated, how long is it compared with the denominator minus one? That tells you whether you are looking at a full reptend prime like 7 or 17, or a shorter-period case like 13. Keeping the two questions apart is what makes a cyclic number calculator trustworthy: it reports the head and the cycle as distinct pieces instead of blending them into one misleading string.

Denominators sharing a factor with 10 (a factor 2 or 5) always produce a non-repeating head before the repeating cycle begins.

FAQs

What is the repeating cycle of 1/7?

The repeating cycle of 1/7 is 142857, a period of 6 digits. That means the six digits 142857 repeat without end after the decimal point: 0.142857142857... The cycle length, or period, is 6, which is shorter than the prime 7 minus 1.

Is 7 a full reptend prime?

Yes. A prime is a full reptend prime when the period of 1 divided by that prime equals the prime minus 1. For 7, the period of 1/7 is 6, which equals 7 - 1. So 7 qualifies as a full reptend prime, and its repeating block is 142857.

Is 13 a full reptend prime?

No. For 13, 1/13 repeats 076923 with period 6, which is shorter than 13 - 1 = 12. Because the period does not reach the maximum of 12, 13 is not a full reptend prime. A full reptend prime needs a period equal to the prime minus 1.

What is the period of 1/17?

The period of 1/17 is 16 digits: 0588235294117647. Since 16 equals 17 - 1, the repeating block reaches the maximum possible length, so 17 is a full reptend prime. Its cycle is 16 digits long, matching the rule for full reptend primes.

What is 142857 x 7?

142857 x 7 equals 999999. This result ties to the repeating cycle of 1/7: the six-digit block 142857, multiplied by 7, gives six 9s. That relationship is one reason 142857 is a well-known cyclic number, since its multiples rotate through the same digits.

What is the next full-reptend prime after 17?

The next full-reptend prime after 17 is 19. So after 17, which has a period of 16 digits for 1/17, the following prime that reaches a full period is 19. That makes 19 the next full reptend prime in the sequence after 17.

Sources

Related calculators

Bernoulli Number Calculator
Exact Bernoulli numbers B(n) as fractions by the Akiyama-Tanigawa algorithm, with the decimal value, numerator and denominator.
Continued Fraction Calculator
Expand a decimal into its continued fraction and read off the convergents — the best possible rational approximations, from 22/7 up to the legendary 355/113 for pi.
Decimal to Fraction Calculator
Convert any decimal to its exact fraction in lowest terms, with the mixed-number form — 0.375 becomes 3/8, 2.75 becomes 2 3/4.