Too many 5's?

x = 5555555555 5 n number of 5’s \large x=\underbrace{{5555555555\ldots 5}}_{n\text{ number of 5's}} What is the minimum value of n n such that x x is a multiple of 2003?


Inspiration (I was wondering if such number exist)


The answer is 1001.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

when checking for divisibility of n sequences of digits divisible by a prime number we can the sequence as a nth power of 10

555555.... ( n terms ) . . . 5 = 5 × 111111.... ( n terms ) . . . 1 = 5 × 9 × 111111.... ( n terms ) . . . 1 9 = 5 × 999999.... ( n terms ) . . . 9 9 555555....(\text{n terms}) ... 5 = 5 \times 111111 ....(\text{n terms}) ... 1 = \frac{5 \times 9 \times 111111 ....(\text{n terms}) ... 1}{9} = \frac{5 \times 999999 ....(\text{n terms}) ... 9}{9} 5 × 999999.... ( n terms ) . . . 9 9 = 5 × ( 1 0 n 1 ) 9 \Rightarrow \frac{5 \times 999999 ....(\text{n terms}) ... 9}{9} = \frac{5 \times (10^n - 1) }{9}

So if 2003 555555.... ( n terms ) . . . 5 2003 1 0 n 1 2003 | 555555....(\text{n terms}) ... 5 \Rightarrow 2003 |10^n - 1

\Rightarrow 10^n (\mod 2003) \equiv 1 \tag{1}

The following is quoted from Wikipedia article on Euler's theorem Now, Lagrange's theorem states that the order of any subgroup of a finite group divides the order of the entire group Let 1 0 n = a 10^n = a and a 1 ( m o d 2003 ) a \equiv 1(\mod 2003) then a is one of the residual classes, and its powers

a, a^2, .... a^k \equiv 1 (\mod n)\tag{2}

are a subgroup.

Now per Lagrange's theorem, k φ ( n ) k | \mathrm{\varphi}(n) .

So, k \in {1, 2, 7, 11, 13, 14, 22, 26, 77, 91, 143, 154, 182, 286, 1001, 2002} \tag{3}

The only number that has a power relationship with 2002 is 1001 so the smallest number that divides 2003 is 1001

Your solution is wrong. e.g. x^2=1(modp) does not imply that x=1 (modp). This is a polynomial congruence which has 2 solutions.

Omkar Kamat - 5 years, 6 months ago

Log in to reply

This can easily be shown by recollecting the derivation of Euler's theorem by leveraging Lagrange's theorem. Added details in the solution

Abhijit Bhattacharjee - 5 years, 6 months ago

Log in to reply

Your first statement that k divides 2002 is correct as the numbers <0,1,...,2002> form a group under multiplication so k divides 2002 by Lagrange's theorem. I do no understand how you can 'leverage ' this to conclude that 1001 is the solution.

However, my main question is, how do you know that this is the minimum n such that 10^n=1(mod 2003). You haven't ruled out 77 being a solution which is perfectly valid as it divides 2002.

You could say that 2003= 3(mod4) so -1 cannot be a quadratic residue and hence 10^1001=1(mod2003). However, this is not enough to assert that the answer is 1001.

Omkar Kamat - 5 years, 6 months ago

Log in to reply

@Omkar Kamat Simplified the solution.

Abhijit Bhattacharjee - 5 years, 6 months ago

I'm not sure what you mean. If I understand you correctly, you write that a k 1 ( m o d 2003 ) a^k\equiv 1\pmod{2003} with k 2003 k\mid 2003 implies that a , a 2 , , a k 1 ( m o d 2003 ) a,a^2,\dots,a^k\equiv 1\pmod{2003} . Do you mean with this that a 1 ( m o d 2003 ) a\equiv 1\pmod{2003} . Because I don't believe this is true. Can you explain it with more details?

Casper Putz - 5 years, 6 months ago

Log in to reply

@Casper Putz Simplified the solution.

Abhijit Bhattacharjee - 5 years, 6 months ago

It is easy to see that 5(10^(n)-1)=2003*9k where k is an integer. Hence, we must have that 10^(n) =1(mod2003) and 1(mod9) However, 10=1(mod9) so that is ok.

The Euler Totient function tells us that 10^2002=1(mod2003) as 2003 is a prime. Now if 10^n=1 (mod 2003), where n is the smallest integer for which this property is true, then n divides 2003. It easy to see that 10^1001=(((10)^10))^10)*10=1(mod2003).

Now 1001= 11 7 13. We can check that any proper divisor of 1001 does not give 10^n=1(mod2003). So the answer is 1001.

Omkar Kamat - 5 years, 6 months ago

@Abhijit Bhattacharjee Can you expand a bit more on how you used Lagrange's theorem, please? How/why did you selective choose only some prime numbers for k?

Yathish Dhavala - 5 years, 5 months ago

Why the answer is not 12?I checked it using calculator.

Himanshu Goel - 5 years, 6 months ago

Log in to reply

I doubt your calculator may be losing precision while dividing. It is worth noting that 555555555555 2003 = 277361735 350 2003 \frac{555555555555}{2003} = 277361735\frac{350}{2003}

Abhijit Bhattacharjee - 5 years, 6 months ago
Eli Ross Staff
Dec 8, 2015

I'll let someone else post the Number Theory solution.

In the meantime, we can quickly solve with code. It is good to be efficient by only keeping track of the remainders for n = 1 , 2 , 3 , n=1,2,3,\ldots 5's, rather than actually creating the entire n n digit number.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x = 5
n = 1
success = False

while success == False:
    n += 1
    x = (10*x + 5) % 2003
    if x == 0:
        print n
        success = True

returns 1001.

Have a stab at generalization of this over here

Vikram Pandya - 5 years, 6 months ago

1
2
3
4
5
n, j = 1, 5
while j%2003!=0:
   j+=5*10**n
   n += 1
print n

Yathish Dhavala - 5 years, 5 months ago

The answer must be a divisor of ϕ ( 2003 ) = 2002 = 2 7 11 13 \phi(2003) = 2002 = 2\cdot 7\cdot 11\cdot 13 . That leaves in principle 16 possibilities: 1 , 2 , 7 , 11 , 13 , 14 , 22 , 26 , 77 , 91 , 143 , 154 , 182 , 286 , 1001 , 2002 1, 2, 7, 11, 13, 14, 22, 26, 77, 91, 143, 154, 182, 286, 1001, 2002 .

We need the smallest of these values n n for which 1 0 n 1 10^n \equiv 1 mod 2003.

I calculated the powers of 10, using 1 0 m + n = 1 0 m 1 0 n mod 2003 10^{m+n} = 10^m\cdot 10^n\ \text{mod}\ 2003 : 1 0 4 15 1 0 7 979 1 0 11 664 1 0 13 301 1 0 8 225 1 0 14 996 1 0 22 236 1 0 26 466 1 0 16 550 1 0 32 47 1 0 77 87 1 0 143 485 1 0 91 523 1 0 64 206 1 0 154 443 1 0 286 874 1 0 182 882 1 0 128 373 1 0 256 922 1 0 1001 1 1 0 512 812 \begin{array}{cccc} 10^4 \equiv -15 & 10^7 \equiv -979 & 10^{11} \equiv 664 & 10^{13} \equiv 301 \\ 10^8 \equiv 225 & 10^{14} \equiv -996 & 10^{22} \equiv 236 & 10^{26} \equiv 466 \\ 10^{16} \equiv 550 & & & \\ 10^{32} \equiv 47 & 10^{77} \equiv -87 & 10^{143} \equiv 485 & 10^{91} \equiv 523 \\ 10^{64} \equiv 206 & 10^{154} \equiv -443 & 10^{286} \equiv 874 & 10^{182} \equiv -882 \\ 10^{128} \equiv 373 & & & \\ 10^{256} \equiv 922 & & 10^{1001} \equiv 1 & \\ 10^{512} \equiv 812 & & & \end{array}

(For instance, I calculated 1 0 1001 10^{1001} as 1 0 512 1 0 256 1 0 128 1 0 64 1 0 32 1 0 8 1 0 1 10^{512}\cdot 10^{256}\cdot 10^{128}\cdot 10^{64}\cdot 10^{32}\cdot 10^8\cdot 10^1 .)

From 1 0 1001 1 10^{1001} \equiv 1 mod 2003 it follows that 111 1 111\cdots 1 (1001 digits) is a multiple of 2003, and therefore so is 555 5 555\cdots 5 .

Elkio deAtn
Dec 9, 2015

Do the division 1/2003. Period of repeating decimal digits is 1001. This is the required answer. How does it work?

1/n has a property that its period of terminating digits will be equal to k iff n | (999... k times) for smallest k.

Since 5 and 9 are coprime, we will get k for (5555... k times) also.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...