2017 Divides String of 1s

Let O n = 111111 1 number of 1’s = n . O_n = \underbrace{111111\ldots1}_{\text{ number of 1's }=\, n}.

Find the smallest positive integer n n such that 2017 O n 2017 \mid O_n .

If there is no such n n , enter 0.


The answer is 2016.

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.

3 solutions

Calvin Lin Staff
Jan 10, 2017

Observe that O n = 1 0 n 1 9 O_n = \frac{ 10^n - 1 } { 9 } . Since gcd ( 9 , 2017 ) = 1 \gcd (9, 2017) = 1 , hence we are looking for the smallest n n such that 1 0 n 1 ( m o d 2017 ) 10^n \equiv 1 \pmod{2017} . Denote this number by N N . This is also known as the order of 10 mod 2017.

From Fermat's little theorem , since 2017 is a prime, hence we know that 1 0 2016 1 ( m o d 2017 ) 10 ^ { 2016 } \equiv 1 \pmod {2017} . This establishes that N 2016 N \leq 2016 (IE 2016 can be achieved). We will show that N = 2016 N = 2016 by proving that no smaller number will work (IE 2016 is a lower bound).

Claim: N 2016 N \mid 2016 .

Proof: Let 2016 = N q + r 2016 = Nq + r , where 0 r < N 0 \leq r < N .
Then 1 1 0 2016 1 0 N q × 1 0 r 1 0 r ( m o d 2017 ) 1 \equiv 10^{2016} \equiv 10^{Nq} \times 10^r \equiv 10 ^ r \pmod{2017} . Since N N is the smallest positive integer such that 1 0 N 1 ( m o d 2017 ) 10 ^N \equiv 1 \pmod{2017} , this shows that r r is not a positive integer so r = 0 r = 0 . Hence 2016 = N q 2016 = Nq as desired. _\square

Claim: 2016 = 2 5 × 3 2 × 7 2016 = 2^5 \times 3^2 \times 7 . If for M = 2016 2 , 2016 3 , 2016 7 M = \frac{2016}{2}, \frac{2016}{3}, \frac{2016}{7} , we have 1 0 M ≢ 1 ( m o d 2017 ) 10 ^ M \not \equiv 1 \pmod{2017} , then N = 2016 N = 2016 .

Proof: Since N 2016 N \mid 2016 , suppose that N 2016 N \neq 2016 . Then N N must divide (at least) one of the values of M M . For that chosen value, let M = N q M = Nq . Then, 1 1 0 N q 1 0 m ≢ 1 ( m o d 2017 ) 1 \equiv 10^{Nq} \equiv 10^m \not \equiv 1 \pmod{2017} which is a contradiction. _\square

Claim: For M = 2016 2 , 2016 3 , 2016 7 M = \frac{2016}{2}, \frac{2016}{3}, \frac{2016}{7} , then 1 0 M ≢ 1 ( m o d 2017 ) 10 ^ M \not \equiv 1 \pmod{2017} .

Proof: We have to (tediously) check the values. We obtain:
1 0 1008 2016 ( m o d 2017 ) , 10 ^{1008} \equiv 2016 \pmod{2017},
1 0 672 294 ( m o d 2017 ) , 10 ^{672} \equiv 294 \pmod{2017},
1 0 288 79 ( m o d 2017 ) 10 ^{288} \equiv 79 \pmod{2017} . _\square

Note: The above shows that 10 is a primitive root of 2017. Unfortunately, there isn't an easy general way to show that a number is a primitive root, other than checking in the manner that we did.


(Calvin's rant about minimum)

Remember that when we say N N is a minimum, it must satisfy both of the following conditions:
1. It is a lower bound.
2. It can be achieved.

In this case, condition 2 is easy to check, and condition 1 requires work.

"We have to (tediously) check the values."

How did you do it? I can't think of an easy way to do so TT.TT

Manuel Kahayon - 4 years, 4 months ago

Log in to reply

I did it tediously. It is direct to do, but it just requires a lot of calculations in mod. I would recommend repeated squaring as a fast way to get the answer.

If you understand how to do this, and do not need the practice, then yes wolfram could calculate it immediately.

Calvin Lin Staff - 4 years, 4 months ago

I would use a Modular Exponentiation Calculator; there are plenty of them online.

Muhammad Rasel Parvej - 4 years, 4 months ago

Pretty neat, I must say! Thanks!

Muhammad Rasel Parvej - 4 years, 5 months ago
Kushal Bose
Jan 6, 2017

O n = 111 11 = 1 0 n 1 9 O_n= \overline{111\cdots{ } \cdots{ } \cdots{ }11} \\ =\dfrac{10^n-1}{9}

Using Euler's Totient Function ϕ ( 2017 ) = 2016 \phi (2017)=2016 as 2017 2017 is a prime number.

So, 1 0 2016 1 ( m o d 2017 ) 10^{2016} \equiv 1 \pmod{2017} as g c d ( 10 , 2017 ) = 1 gcd(10,2017)=1

Again 1 0 2016 1 ( m o d 9 ) 10^{2016} \equiv 1 \pmod{9}

It can be written as 1 0 n 1 10^n-1 is both divisible by 2017 2017 and 9 9

Therefore , 1 0 2016 1 = 9 × 2017 l 10^{2016} -1=9 \times 2017 l where l Z + l \in Z^+

1 0 2016 1 9 = 2017 l 2017 1 0 2016 1 9 \dfrac{10^{2016} -1}{9}=2017 l \implies 2017 | \dfrac{10^{2016} -1}{9}

So, the smallest n = 2016 n=2016

This solution is incomplete.

Remember that if a number is a minimum, it has to satisfy 2 conditions.
1. It is a lower bound.
2. It can be achieved.

You have shown that 2) It can be achieved. However, how do we know that there is no smaller number that would work?


As an explicit counter example, if we replaced 2017 by 11, then the answer isn't 11 1 11 - 1 , even though 11 1 0 10 1 9 11 \mid \frac{ 10 ^ {10 } - 1 } { 9} (can be achieved). Instead, the answer is 2, with N n = 11 N_n = 11 (so 10 isn't a lower bound).

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

But how I will show that 2016 is the lower bound ???

Kushal Bose - 4 years, 5 months ago

Log in to reply

It would take work. Essentially, you are asked for the Order of 10 mod 2017.

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

@Calvin Lin Any hint u can provide ?

Kushal Bose - 4 years, 5 months ago

Log in to reply

@Kushal Bose Prove that 2016/p doesn't work for all primes p that divide 2016.

See Group theory

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

@Calvin Lin Ok I will try

Kushal Bose - 4 years, 5 months ago

Log in to reply

@Kushal Bose A simple way to fix this is to recall the Carmichael's Lambda function .

Pi Han Goh - 4 years, 5 months ago

Log in to reply

@Pi Han Goh Can you elaborate further? I'm not sure that approach would work.

The Carmichael Lambda function is a global property (about all a a where gcd ( a , 2017 ) = 1 \gcd(a,2017) = 1 ), whereas we're looking for a local property (where a = 10 a = 10 ).

E.g. If we wanted to find the smallest n n such that 1 n 1 ( m o d 2017 ) 1^{n} \equiv 1 \pmod{2017} , I don't see how knowing λ ( 2017 ) \lambda (2017) would affect the answer.

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

@Calvin Lin Sorry, I misinterpreted the function again. I'm back to square one again... = (

Pi Han Goh - 4 years, 5 months ago
Ashish Gupta
Feb 9, 2017

Having a look at other solutions and comments, I got to know about a counter example of 11. Indeed, 11 divides (10^2 - 1) / 9 but it is as much fault of the power of 10 as it is of 11 itself. You see, 11 = 10 + 1 and that opens a whole new chain of divisibility taking advantage of the relationship between the terms (a^n - 1) and (a + 1).

It is safe to assume that 11 is an exception rather than the rule. Further examination required.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...