All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Repeating decimals (Posted on 2006-09-25) Difficulty: 3 of 5
The decimal expansion of 1/271 repeats with a period of length 5:
.003690036900369 ...

However, it is not the smallest number q for which the decimal expansion of 1/q has a repetition length of 5.

Find the smallest q so that the decimal expansion of 1/q has repetition length n for each of {1, 2, ..., 10}

Is there a simple way of finding such a number?

See The Solution Submitted by Jer    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Hints/Tips re: computer exploration | Comment 2 of 11 |
(In reply to computer exploration by Charlie)

By doing the division into 1 by the long division algorithm instead of by the internal workings of the computer, the table can be extended:

rep length   prime fact of rep-9        smallest q   factors of smallest q
 2            3 3 11                         11        11
 3            3 3 3 37                       27        3 3 3
 4            3 3 11 101                     101       101
 5            3 3 41 271                     41        41
 6            3 3 3 7 11 13 37               7         7
 7            3 3 239 4649                   239       239
 8            3 3 11 73 101 137              73        73
 9            3 3 3 3 37 333667              81        3 3 3 3
 10           3 3 11 41 271 9091             451       11 41
 11           3 3 21649 513239               21649     21649
 12           3 3 3 7 11 13 37 101 9901      707       7 101
 13           3 3 53 79 265371653            53        53
 14           3 3 11 239 4649 909091         2629      11 239
 15           3 3 3 31 37 41 271 2906161     31        31

It's still undetermined how the choices of prime factors are made, such as 7 * 101 = 707 for length 12.

The long division code:

  q$ = "": dnd$ = "1"
  DO
    frst = 1
    WHILE VAL(dnd$) < prod
      dnd$ = dnd$ + "0"
      IF frst = 0 THEN q$ = q$ + "0"
      frst = 0
    WEND
    q = INT(VAL(dnd$) / prod)
    r = VAL(dnd$) - q * prod
    dnd$ = STR$(r)
    q$ = q$ + LTRIM$(STR$(q))
  LOOP UNTIL LEN(q$) > 25


  Posted by Charlie on 2006-09-25 11:35:02
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information