Multiple of 3's digits and 0's digits

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.

9 solutions

Mustafa Alelg
May 14, 2018

Relevant wiki: Pigeonhole Principle - Problem Solving

Take the infinite set of the numbers 3 , 33 , 333 , 3333 , . . . {3, 33, 333, 3333, ...} 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 333...33300..00 333...33300..00 which is divisible by 2018.

How do you know here exist two numbers have the same remainder when divided by 2018?

Pi Han Goh - 3 years ago

Log in to reply

because there are only 2018 possible remainders.

Jeremy Galvagni - 3 years ago

Pigeonhole principle.

Livio Leiva - 3 years ago

because this set is infinitive and the remainders are limited.

Xu Liangjun - 3 years ago

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 ...

Nazariy Boychuk - 3 years ago

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.

Alex Li - 3 years ago

Log in to reply

@Alex Li Thank you. I did not understand the beginning.

Nazariy Boychuk - 3 years ago

@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.

Xu Liangjun - 3 years ago

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.

Nazariy Boychuk - 3 years ago

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.

Mustafa Alelg - 3 years ago

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.

João Pedro Afonso - 3 years ago

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.

Mustafa Alelg - 3 years ago

The first such would seem to be: 2018 * 1651800462504129501156260323752890650809382226627023455566567558638916418896597291047241493227618103733069045259332672613148331681532870829203832177073009580442682523951106706309877766765774694416914436736042286091840105715229600264288074000660720185 = 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333330

Duncan Booth - 3 years ago

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...

Mahmudul Hassan Alif - 2 years, 10 months ago

Oh man that's elegant. I never thought of the pigeonhole principle. Great job!

Caspian Berggren - 3 years ago

Oh,this is reall brilliant.

Xu Liangjun - 3 years ago

Can someone help to explain the second statement? Cos I don't get it.

Nate Tan - 3 years ago

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.

Mustafa Alelg - 3 years ago
David Vreken
May 20, 2018

Relevant wiki: Fermat's Little Theorem

Since 1009 1009 is prime, by Fermat's little theorem 1 0 1008 1 10^{1008} - 1 is divisible by 1009 1009 . Written out, this number would consist of 1008 1008 9 9 s, which means it is divisible by 3 3 , and dividing this number by 3 3 would give a number that consists of 1008 1008 3 3 s that is still divisible by 1009 1009 .

Now multiplying this number ( 1 0 1008 1 3 \frac{10^{1008} - 1}{3} ) by 10 10 would give a number that consists of 1008 1008 3 3 s followed by one 0 0 .

This new number ( 1 0 1008 1 3 10 \frac{10^{1008} - 1}{3} \cdot 10 ) consists only of the digits 3 3 and 0 0 , and is divisible by 2 2 and 1009 1009 , which means it is also divisible by 2018 2018 .

The simplest answer

Department 8 - 3 years ago

Log in to reply

very elegant

OJ Streets - 3 years ago
Mark Hennings
May 20, 2018

Relevant wiki: Modular Arithmetic - Problem Solving - Intermediate

Since 1009 1009 is prime, 1 0 1008 1 ( m o d 1009 ) 10^{1008} \equiv 1 \pmod{1009} . In fact we can show that 1 0 252 1 ( m o d 1009 ) 10^{252} \equiv 1 \pmod{1009} , and that 1 0 126 1 ( m o d 1009 ) 10^{126} \equiv -1 \pmod{1009} . Thus 1 0 126 + 1 0 ( m o d 1009 ) 10^{126} + 1 \equiv 0 \pmod{1009} , so that 1 0 127 + 10 0 ( m o d 2018 ) 10^{127} + 10 \equiv 0 \pmod{2018} , and hence 3 ( 1 0 127 + 10 ) 0 ( m o d 2018 ) 3(10^{127} + 10) \equiv 0 \pmod{2018} .

Can you clarify why 1 0 126 1 ( m o d 1009 ) 10^{126} \equiv -1 \pmod{1009} ?

Mustafa Alelg - 3 years ago

Log in to reply

If 1 0 2 n 1 ( m o d 1009 ) 10^{2n} \equiv 1 \pmod{1009} , then ( 1 0 n ) 2 1 ( m o d 1009 ) (10^n)^2 \equiv 1 \pmod{1009} , and so 1 0 n ± 1 ( m o d 1009 ) 10^n \equiv \pm1 \pmod{1009} . It turns out on calculation that 1 0 252 1 ( m o d 1009 ) 10^{252} \equiv 1 \pmod{1009} but that 1 0 126 ≢ 1 ( m o d 1009 ) 10^{126} \not\equiv 1 \pmod{1009} and hence 1 0 126 1 ( m o d 1009 ) 10^{126} \equiv -1 \pmod{1009} .

Mark Hennings - 3 years ago

A more straightforward way to find the smallest power( k k ) of b = 10 b=10 which satisfies b k 1 ( m o d n ) b^{k}\equiv 1\pmod{n} is to take a look at the decimal representation for a = 1 n a=\frac{1}{n} . As we can show, a a 's period turns out to be exactly the k k we need. To confirm this, notice that b k a a ( m o d 1 ) b^k\cdot a\equiv a\pmod{1} , thus n / b k 1 n/b^k-1 . Of course, the above argument can be modified to work for an arbitrary base b b by simply considering a numerical system with a base b b instead. Indeed, 1 1009 = 0. ( 000991080277502477700693756194251734390485629335976214073339940535183349851337958374628344895936570862239841427155599603567888999008919722497522299306243805748265609514370664023785926660059464816650148662041625371655104063429137760158572844400396432111001 ) \frac{1}{1009}=0.(000991080277502477700693756194251734390485629335976214073339940535183349851337958374628344895936570862239841427155599603567888999008919722497522299306243805748265609514370664023785926660059464816650148662041625371655104063429137760158572844400396432111001) has a period of 252 digits, as expected. Note that if a a isn't periodic, then no such k k exists.

Ivo Zerkov - 2 years, 10 months ago

Why can't 10^126 have the.remainder of 1 when divided by 1009

Tanya Pattnaik - 3 years ago

Log in to reply

Check it out: 1 0 1 10 1 0 2 100 1 0 4 919 1 0 8 28 1 0 16 784 1 0 32 175 1 0 64 355 1 0 126 1 0 2 + 4 + 8 + 16 + 32 + 64 = 1008 \begin{array}{rclcrcl} 10^1 & \equiv & 10 & \hspace{2cm} & 10^2 & \equiv & 100 \\ 10^4 & \equiv & 919 & & 10^8 & \equiv & 28 \\ 10^{16} & \equiv & 784 & & 10^{32} & \equiv & 175 \\ 10^{64} & \equiv & 355 & & 10^{126} & \equiv & 10^{2+4+8+16+32+64} \; = \; 1008 \end{array} modulo 1009 1009 .

Mark Hennings - 3 years ago
Pierre Lapôtre
May 23, 2018

1 0 2 100 m o d ( 1009 ) 1 0 9 280 m o d ( 1009 ) 1 0 14 250 m o d ( 1009 ) 1 0 23 379 m o d ( 1009 ) \begin{array}{cccc} 10^{2} \equiv &100&&mod(1009)\\ 10^{9}\equiv &280&&mod(1009)\\ 10^{14}\equiv&250&&mod(1009)\\ 10^{23}\equiv&379&&mod(1009) \end{array} \

100 + 280 + 250 + 379 = 1009 so\ 1 0 23 + 1 0 14 + 1 0 9 + 1 0 2 0 m o d ( 1009 ) 10^{23}+10^{14}+10^{9}+10^{2}\equiv 0\quad mod(1009) \ 1 0 23 + 1 0 14 + 1 0 9 + 1 0 2 10^{23}+10^{14}+10^{9}+10^{2} even number so 1 0 23 + 1 0 14 + 1 0 9 + 1 0 2 10^{23}+10^{14}+10^{9}+10^{2} divisible by 2018, likewise 3 × ( 1 0 23 + 1 0 14 + 1 0 9 + 1 0 2 ) 3\times(10^{23}+10^{14}+10^{9}+10^{2}) divisible by 2018. So, for example, 300000000300003000000300 divisible by 2018.

Beautiful and simple number theory solution. :)

Mustafa Alelg - 3 years ago
Timothe Ayy_Lmao
May 27, 2018

Ali Mirzaeyan
May 23, 2018

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: 2018 3 Z = 30033....330..303 2018*3*Z=30033....330..303 . so if we simplify both sides of the equation it turns out we are looking for some Z that satisfy equation 2018 Z = 1.10011..110..101 2018Z=1 .10011..110..101 , 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 i to 1 0 i 10^i . so after got Z, then K can obtain from 3 Z 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?

Mrigank Singh - 3 years ago

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?

Nestor Abad
May 22, 2018

Just trying and adjusting by hand... and with the little help of a spreadsheet doing the multiplication algorithm:

150 298 975 720 185 × 2018 = 303 303 333 003 333 330 150\,298\,975\,720\,185\times 2018=303\,303\,333\,003\,333\,330

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

Michael Genius
May 22, 2018

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?

祝齐 胡 - 3 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...