Is there a positive integer divisible by 2018 which only consists of the digits 3 and 0 (in base 10)?
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.
How do you know here exist two numbers have the same remainder when divided by 2018?
Log in to reply
because there are only 2018 possible remainders.
Pigeonhole principle.
because this set is infinitive and the remainders are limited.
Log in to reply
Infinite set does not mean that it has all remainders. The set {1, 2019, 4037, 6055, ...} (arithmetic progression) indeed is infinite but it has only 1 remainder: 1! I need a proof for the first statement: ... there exist two numbers ...
Log in to reply
@Nazariy Boychuk – Right, however, for that set, there exist 2 numbers that share the same remainder (actually, any 2, as both have remainder 1). That is what is being stated, not that all remainders are used.
Log in to reply
@Alex Li – Thank you. I did not understand the beginning.
@Nazariy Boychuk – you are right.infinite set does not mean that it has all remainders. But you may fail to get my point. Just as you have mentioned,the set {1,2019,4037,......} itself have the same remainder 1.This is included in my statement. Actually, infinite is far too strong as a condition.In this case, we only need a limited set{3,33,333.....}which contains the first 2019 elements to make sure there exists two numbers sharing the same remainder when divided by 2018.
Log in to reply
@Xu Liangjun – Thank you also. The problem was not that I failed to get your point. I completely misunderstood the author proof. Anyway, you helped me to grasp the idea that I missed.
Take the first 2019 terms from the sequence. We know that there's 2018 possibility for any number divided by 2018. From pigeon hall principle there exist two numbers have the same remainder.
It's difficult to argue with such elegant solution. It's mind boggling because it can be used to prove that any number has a multiple of the form "d+0*" (kind of regular expression where d means a specific digit not zero, + means one or more of the before and 0* means any zeros including none). You can even limit how many digits non zero to expect on the shorter solution.
Your solution was a paradox to me for some time. My efforts went instead in the direction of finding the multiplier to get the wanted multiple, and I had came to the conclusion that there was none. But I made a mistake. What I proved was, there is no multiplier in the form "[0-4]+" that multiplied by 2018, gives a number with only zeros and ones as digits. I should have suspected when I saw the digits I was getting from my method.
Log in to reply
Exactly! We can further generalize the idea of this problem to say: For ANY number we can find a multiple of it which consists only from 1 digits and 0 digits.
The first such would seem to be: 2018 * 1651800462504129501156260323752890650809382226627023455566567558638916418896597291047241493227618103733069045259332672613148331681532870829203832177073009580442682523951106706309877766765774694416914436736042286091840105715229600264288074000660720185 = 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333330
Log in to reply
How did you compute this? I've been trying to write a piece of code in Python to first calculate 33333... to x digits in mod 2018 but the code just starts giving inaccurate results after the 17th digit...
Oh man that's elegant. I never thought of the pigeonhole principle. Great job!
Oh,this is reall brilliant.
Can someone help to explain the second statement? Cos I don't get it.
Log in to reply
Every integer gives a unique remainder when divided by any integer. For example: 17 ÷ 3 gives 2 as a remainder. 25 ÷ 6 gives 1 as a remainder, and 35 ÷ 7 gives 0 as a remainder. If you take any 2 integers have the same remainder when divided by a fixed integer and subtract them you'll get a multiple of that number. 25 - 4 = 21 = 7×3. 27 - 13 = 7×2.
Relevant wiki: Fermat's Little Theorem
Since 1 0 0 9 is prime, by Fermat's little theorem 1 0 1 0 0 8 − 1 is divisible by 1 0 0 9 . Written out, this number would consist of 1 0 0 8 9 s, which means it is divisible by 3 , and dividing this number by 3 would give a number that consists of 1 0 0 8 3 s that is still divisible by 1 0 0 9 .
Now multiplying this number ( 3 1 0 1 0 0 8 − 1 ) by 1 0 would give a number that consists of 1 0 0 8 3 s followed by one 0 .
This new number ( 3 1 0 1 0 0 8 − 1 ⋅ 1 0 ) consists only of the digits 3 and 0 , and is divisible by 2 and 1 0 0 9 , which means it is also divisible by 2 0 1 8 .
The simplest answer
Relevant wiki: Modular Arithmetic - Problem Solving - Intermediate
Since 1 0 0 9 is prime, 1 0 1 0 0 8 ≡ 1 ( m o d 1 0 0 9 ) . In fact we can show that 1 0 2 5 2 ≡ 1 ( m o d 1 0 0 9 ) , and that 1 0 1 2 6 ≡ − 1 ( m o d 1 0 0 9 ) . Thus 1 0 1 2 6 + 1 ≡ 0 ( m o d 1 0 0 9 ) , so that 1 0 1 2 7 + 1 0 ≡ 0 ( m o d 2 0 1 8 ) , and hence 3 ( 1 0 1 2 7 + 1 0 ) ≡ 0 ( m o d 2 0 1 8 ) .
Can you clarify why 1 0 1 2 6 ≡ − 1 ( m o d 1 0 0 9 ) ?
Log in to reply
If 1 0 2 n ≡ 1 ( m o d 1 0 0 9 ) , then ( 1 0 n ) 2 ≡ 1 ( m o d 1 0 0 9 ) , and so 1 0 n ≡ ± 1 ( m o d 1 0 0 9 ) . It turns out on calculation that 1 0 2 5 2 ≡ 1 ( m o d 1 0 0 9 ) but that 1 0 1 2 6 ≡ 1 ( m o d 1 0 0 9 ) and hence 1 0 1 2 6 ≡ − 1 ( m o d 1 0 0 9 ) .
A more straightforward way to find the smallest power( k ) of b = 1 0 which satisfies b k ≡ 1 ( m o d n ) is to take a look at the decimal representation for a = n 1 . As we can show, a 's period turns out to be exactly the k we need. To confirm this, notice that b k ⋅ a ≡ a ( m o d 1 ) , thus n / b k − 1 . Of course, the above argument can be modified to work for an arbitrary base b by simply considering a numerical system with a base b instead. Indeed, 1 0 0 9 1 = 0 . ( 0 0 0 9 9 1 0 8 0 2 7 7 5 0 2 4 7 7 7 0 0 6 9 3 7 5 6 1 9 4 2 5 1 7 3 4 3 9 0 4 8 5 6 2 9 3 3 5 9 7 6 2 1 4 0 7 3 3 3 9 9 4 0 5 3 5 1 8 3 3 4 9 8 5 1 3 3 7 9 5 8 3 7 4 6 2 8 3 4 4 8 9 5 9 3 6 5 7 0 8 6 2 2 3 9 8 4 1 4 2 7 1 5 5 5 9 9 6 0 3 5 6 7 8 8 8 9 9 9 0 0 8 9 1 9 7 2 2 4 9 7 5 2 2 2 9 9 3 0 6 2 4 3 8 0 5 7 4 8 2 6 5 6 0 9 5 1 4 3 7 0 6 6 4 0 2 3 7 8 5 9 2 6 6 6 0 0 5 9 4 6 4 8 1 6 6 5 0 1 4 8 6 6 2 0 4 1 6 2 5 3 7 1 6 5 5 1 0 4 0 6 3 4 2 9 1 3 7 7 6 0 1 5 8 5 7 2 8 4 4 4 0 0 3 9 6 4 3 2 1 1 1 0 0 1 ) has a period of 252 digits, as expected. Note that if a isn't periodic, then no such k exists.
Why can't 10^126 have the.remainder of 1 when divided by 1009
Log in to reply
Check it out: 1 0 1 1 0 4 1 0 1 6 1 0 6 4 ≡ ≡ ≡ ≡ 1 0 9 1 9 7 8 4 3 5 5 1 0 2 1 0 8 1 0 3 2 1 0 1 2 6 ≡ ≡ ≡ ≡ 1 0 0 2 8 1 7 5 1 0 2 + 4 + 8 + 1 6 + 3 2 + 6 4 = 1 0 0 8 modulo 1 0 0 9 .
1 0 2 ≡ 1 0 9 ≡ 1 0 1 4 ≡ 1 0 2 3 ≡ 1 0 0 2 8 0 2 5 0 3 7 9 m o d ( 1 0 0 9 ) m o d ( 1 0 0 9 ) m o d ( 1 0 0 9 ) m o d ( 1 0 0 9 ) \
100 + 280 + 250 + 379 = 1009 so\ 1 0 2 3 + 1 0 1 4 + 1 0 9 + 1 0 2 ≡ 0 m o d ( 1 0 0 9 ) \ 1 0 2 3 + 1 0 1 4 + 1 0 9 + 1 0 2 even number so 1 0 2 3 + 1 0 1 4 + 1 0 9 + 1 0 2 divisible by 2018, likewise 3 × ( 1 0 2 3 + 1 0 1 4 + 1 0 9 + 1 0 2 ) divisible by 2018. So, for example, 300000000300003000000300 divisible by 2018.
Beautiful and simple number theory solution. :)
we know a number is divisible by three whenever the sum of its digits is divisible by three. because on the right side there is a sequence of 3 and 0, so the left side should be multiple of 3, which means: 2 0 1 8 ∗ 3 ∗ Z = 3 0 0 3 3 . . . . 3 3 0 . . 3 0 3 . so if we simplify both sides of the equation it turns out we are looking for some Z that satisfy equation 2 0 1 8 Z = 1 . 1 0 0 1 1 . . 1 1 0 . . 1 0 1 , the right side means a sequence of 0 and 1. So the easiest way to obtain this sequence is to look at the binary representation of 2018 and multiply each bit significant i to 1 0 i . so after got Z, then K can obtain from 3 ∗ Z .
I understood till the 2018Z = strings of 1 and 0. However I am not able to understand your sentence, "look at the binary representation of 2018 and multiply each bit significant i to 10^i". Can you please explain? For e.g. 2018 is 1111100010 in binary. So what to do after this to get the sequence?
Thanks for a solution. But can't figure out how we can prove that the binary representation multiplied by powers of 10 is divisible by that number. How can we conclude that the decimal number equals 2018 times Z? How is 2018 * Z = 11111100010?
Just trying and adjusting by hand... and with the little help of a spreadsheet doing the multiplication algorithm:
1 5 0 2 9 8 9 7 5 7 2 0 1 8 5 × 2 0 1 8 = 3 0 3 3 0 3 3 3 3 0 0 3 3 3 3 3 3 0
As you see in the image, working with 1009 you just need a multiple of it consisting of 1's and 0's, and when you have it, multiply it by 15.
2018 multiplied by 3000 for example
Consider the first 2019 numbers 3, 33, 333, ... , 333...33 (2019 threes in total). By pigeonhole principle, there will be two of them that are congruent mod 2018. These two numbers’ difference is apparently divisible by 2018 and only consists of the figures 0 and 3, i.e. it has the required properties.
why the difference is only consisting of 3 or 0?
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Pigeonhole Principle - Problem Solving
Take the infinite set of the numbers 3 , 3 3 , 3 3 3 , 3 3 3 3 , . . . there exist two numbers have the same remainder when divided by 2018. Take those numbers and the difference would be a number of the form 3 3 3 . . . 3 3 3 0 0 . . 0 0 which is divisible by 2018.