Number Discrimination 3

Let a 1 , a 2 , a 3 , a 4 , a_1, a_2, a_3, a_4, \ldots be a sequence of all positive integers arranged in ascending order that have the following properties:

  • It is not a multiple of 3
  • It contains neither the digits 1, 2 nor 3

Here are the first few terms in this sequence: 4 , 5 , 7 , 8 , 40 , 44 , 46 , 47 , 49 , 50 , 55 , 56 , 4,\,5,\,7,\,8,\,40,\,44,\,46,\,47,\,49,\,50,\,55,\,56,\,\ldots Find the value of a 1153 a_{1153} .


See also:


The answer is 8050.

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.

4 solutions

Donglin Loo
Jul 7, 2018

You must attempt Number Discrimination 2 first before attempting this. In that problem, the answer is 1600 1600 . So, there are 1600 1600 positive integers smaller than 10000 10000 which satisfy the properties above.

The question above is asking for a 1153 a_{1153} when the numbers are arranged in ascending order. Considering the difference between 1153 1153 and 1600 1600 is smaller compared to the difference between 4 4 and 1153 1153 , we go for reversing method. Yup, just like how you reverse your vehicle.


We know that numbers smaller than 10000 10000 have a maximum of four digits. So, we look at the case when the first digit is 9 9 and there are four digits. Among them, we hope to eliminate multiples of 3 3 .

By divisibility rule , the sum of digits of a multiple of 3 3 is also a multiple of 3 3 .

9 9 is divisible by 3 3 . So, it follows that the remaining 3 3 digits must sum up to a multiple of 3 3 .

We know that the digits that can be used are 0 , 4 , 5 , 6 , 7 , 8 , 9 0,4,5,6,7,8,9 only, having 7 7 possible choices.

0 0 ( m o d 3 ) , 4 1 ( m o d 3 ) , 5 2 ( m o d 3 ) , 6 0 ( m o d 3 ) , 7 1 ( m o d 3 ) , 8 2 ( m o d 3 ) , 9 0 ( m o d 3 ) 0\equiv 0(mod3), 4\equiv1(mod3), 5\equiv2(mod3), 6\equiv0(mod3), 7\equiv1(mod3), 8\equiv2(mod3), 9\equiv0(mod3)

Now, we are finding multiples of 3 3 using the sum of 0 , 1 , 2 0,1,2 three times.

Only the following combinations \textbf{combinations} are possible:

0 + 0 + 0 , 0 + 1 + 2 , 1 + 1 + 1 , 2 + 2 + 2 0+0+0,0+1+2,1+1+1,2+2+2

For 0 + 0 + 0 0+0+0 , the number of integers are 3 3 3 = 27 3\cdot3\cdot3=27

For 0 + 1 + 2 0+1+2 , the number of integers are 3 2 2 3 ! = 72 3\cdot2\cdot2\cdot3!=72

For 1 + 1 + 1 1+1+1 , the number of integers are 2 2 2 = 8 2\cdot2\cdot2=8

For 2 + 2 + 2 2+2+2 , the number of integers are 2 2 2 = 8 2\cdot2\cdot2=8

So, the number of remaining which meet our requirements = 7 3 27 72 8 8 = 228 =7^3-27-72-8-8=228


Now, we look at the case when the first digit is 8 8 and there are four digits. Among them, we hope to eliminate multiples of 3 3 .

By divisibility rule , the sum of digits of a multiple of 3 3 is also a multiple of 3 3 .

8 leaves a remainder of 2 2 when divided by 3 3 . So, it follows that the remaining 3 3 digits must sum up to a number which leaves a remainder of 1 1 when divided by 3 3 .

We know that the digits that can be used are 0 , 4 , 5 , 6 , 7 , 8 , 9 0,4,5,6,7,8,9 only, having 7 7 possible choices.

0 0 ( m o d 3 ) , 4 1 ( m o d 3 ) , 5 2 ( m o d 3 ) , 6 0 ( m o d 3 ) , 7 1 ( m o d 3 ) , 8 2 ( m o d 3 ) , 9 0 ( m o d 3 ) 0\equiv 0(mod3), 4\equiv1(mod3), 5\equiv2(mod3), 6\equiv0(mod3), 7\equiv1(mod3), 8\equiv2(mod3), 9\equiv0(mod3)

Now, we are finding numbers which leave a remainder of 1 1 when divided by 3 3 using the sum of 0 , 1 , 2 0,1,2 three times.

Only the following combinations \textbf{combinations} are possible:

0 + 0 + 1 , 0 + 2 + 2 , 1 + 1 + 2 0+0+1,0+2+2,1+1+2

For 0 + 0 + 1 0+0+1 , the number of integers are 3 3 2 3 ! 2 ! = 54 3\cdot3\cdot2\cdot\cfrac{3!}{2!}=54

For 0 + 2 + 2 0+2+2 , the number of integers are 3 2 2 3 ! 2 ! = 36 3\cdot2\cdot2\cdot\cfrac{3!}{2!}=36

For 1 + 1 + 2 1+1+2 , the number of integers are 2 2 2 3 ! 2 ! = 24 2\cdot2\cdot2\cdot\cfrac{3!}{2!}=24

So, the number of remaining which meet our requirements = 7 3 54 36 24 = 229 =7^3-54-36-24=229


\therefore the number of integers meeting our requirements ranging from 8000 8000 to 9000 9000 = 229 + 228 = 457 =229+228=457

We then perform the following operation: 1600 457 = 1143 1600-457=1143 .

This shows that the number of integers meeting our requirements but smaller than 8000 = 1143 8000=1143 . It is somewhat close to 1153 1153 .

Now, we push forward our list.

The numbers not smaller than 8000 that meet our requirements are 8000 , 8005 , 8006 , 8008 , 8009 , 8044 , 8045 , 8047 , 8048 , 8050 , . . . 8000,8005,8006,8008,8009,8044,8045,8047,8048,\boxed{8050},...

8050 \boxed{8050} is indeed the value of a 1153 a_{1153} we are looking for!

Sahil Goyat
Jul 4, 2020
1
[i for i in range(1,10000) if i%3!=0 and '1'not in str(i) and '2'not in str(i) and '3'not in str(i)][1152]

Razing Thunder
Jul 1, 2020
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
x=[]
for i in range (1,10000):
    if i%3!= 0:
        if i<10:
            if int(str(i)[0])!= 1 and int(str(i)[0])!=2 and int(str(i)[0])!= 3 :
                x.append(i)
        if i>10 and i <100:
            if int(str(i)[1]) != 1 and int(str(i)[1]) !=  2 and int(str(i)[1]) !=  3 and int(str(i)[0])!= 1 and int(str(i)[0])!=2 and int(str(i)[0])!= 3  :
                x.append(i)
        if i >99 and i < 1000:
            if  int(str(i)[2])!= 1 and int(str(i)[2])!=2 and int(str(i)[2])!= 3 and int(str(i)[1]) != 1 and int(str(i)[1]) !=  2 and int(str(i)[1]) !=  3 and int(str(i)[0])!= 1 and int(str(i)[0])!=2 and int(str(i)[0])!= 3  :
                x.append(i)
        if i>999 and i <10000:
            if  int(str(i)[3])!= 1 and int(str(i)[3])!=2 and int(str(i)[3])!= 3 and int(str(i)[2])!= 1 and int(str(i)[2])!=2 and int(str(i)[2])!= 3   and int(str(i)[1]) != 1 and int(str(i)[1]) !=  2 and int(str(i)[1]) !=  3 and int(str(i)[0])!= 1 and int(str(i)[0])!=2 and int(str(i)[0])!= 3  :
                x.append(i)


print(x)
print(x[1152])

Kenneth Tan
Jul 13, 2018

We have the following lemma and its corollary, a sketch of the proof is given below, you can see the full details in my solution to Number Discrimination 2 :

(numbers that are multiples of 3 but don't contain the digits 1 1 , 2 2 or 3 3 are given the name anti-threes )

Lemma 1: For any 1 0 k 10^k ( k N ) (k\in\mathbb{N}) consecutive non-negative multiples of 3, all 1 0 k 10^k digit sequences 00 0 k 0s \underbrace{00\ldots0}_{k\text{ 0s}} to 99 9 k 9s \underbrace{99\ldots9}_{k\text{ 9s}} appear once in the last k k digits of these 1 0 k 10^k numbers.

Proof:

Assume the contrary and say that some digit sequences from 00 0 k 0s \underbrace{00\ldots0}_{k\text{ 0s}} to 99 9 k 9s \underbrace{99\ldots9}_{k\text{ 9s}} don't appear. We now have 1 0 k 10^k numbers and less than 1 0 k 10^k digit sequences, by piegeonhole principle , there exists two numbers A A and B B that have the same last k k digits, or A B ( m o d 1 0 k ) A\equiv B\pmod{10^k} . Since 3 A , B 3|A, B and gcd ( 3 , 1 0 k ) = 1 \gcd(3, 10^k)=1 , we have A B ( m o d 3 × 1 0 k ) A\equiv B\pmod{3\times10^k} , and since A B A\neq B , we must have A B 3 × 1 0 k |A-B|\geqslant3\times10^k . However, out of these 1 0 k 10^k consecutive non-negative multiples of 3, the difference of any two must be smaller than 3 × 1 0 k 3\times10^k , this is a contradiction. _\square


Corollary 1: For any 1 0 k 10^k consecutive non-negative multiples of 3, where all of them do not contain 1 1 , 2 2 and 3 3 in any place except in the last k k digits, then exactly 7 k 7^k of them are anti-threes .

This is true because by lemma 1 , all digit sequences from 00 0 k 0s \underbrace{00\ldots0}_{k\text{ 0s}} to 99 9 k 9s \underbrace{99\ldots9}_{k\text{ 9s}} appear once, for 1 0 k 10^k consecutive non-negative multiples of 3, 7 k 7^k of them don't contain the digits 1 1 , 2 2 or 3 3 in their last k k places. The digits 1 1 , 2 2 and 3 3 also don't appear anywhere else apart in the last k k digits.

As a direct implication of corollary 1 ,

(1) If we have 10 10 consecutive non-negative multiples of 3, where none of them have 1 1 , 2 2 or 3 3 in all other places except in the units, then 7 7 of these 10 10 numbers are anti-threes .

(2) If we have 100 100 consecutive non-negative multiples of 3, where none of them have 1 1 , 2 2 or 3 3 in all other places except in the units and the tens, then 7 2 = 49 7^2=49 of these 100 100 numbers are anti-threes .

(3) If we have 1000 1000 consecutive non-negative multiples of 3, where none of them have 1 1 , 2 2 or 3 3 in all other places except in the units, the tens and the hundreds, then 7 3 = 343 7^3=343 of these 1000 1000 numbers are anti-threes .


Consider numbers from 1 to 7999, we partition the numbers like so (notation wise, assume the intervals only contain integers): [ 1 , 9 ] 2 anti-threes: { 6 , 9 } [ 10 , 39 ] 0 anti-threes [ 40 , 69 ] 7 anti-threes [ 70 , 99 ] 7 anti-threes [ 100 , 399 ] 0 anti-threes [ 400 , 699 ] 49 anti-threes [ 700 , 999 ] 49 anti-threes [ 1000 , 3999 ] 0 anti-threes [ 4000 , 6999 ] 343 anti-threes \underbrace{[1,9]}_{\text{2 anti-threes: }\{6, 9\}}\quad\underbrace{[10,39]}_{\text{0 anti-threes}}\color{#D61F06}\quad\underbrace{[40,69]}_{\text{7 anti-threes}}\color{#D61F06}\quad\underbrace{[70,99]}_{\text{7 anti-threes}}\color{#333333}\quad\underbrace{[100,399]}_{\text{0 anti-threes}}\color{#EC7300}\quad\underbrace{[400,699]}_{\text{49 anti-threes}}\color{#EC7300}\quad\underbrace{[700,999]}_{\text{49 anti-threes}}\color{#333333}\quad\underbrace{[1000,3999]}_{\text{0 anti-threes}}\color{#20A900}\quad\underbrace{[4000,6999]}_{\text{343 anti-threes}}

[ 7000 , 7009 ] 2 anti-threes: { 7005 , 7008 } [ 7010 , 7039 ] 0 anti-threes [ 7040 , 7069 ] 7 anti-threes [ 7070 , 7099 ] 7 anti-threes [ 7100 , 7399 ] 0 anti-threes [ 7400 , 7699 ] 49 anti-threes [ 7700 , 7999 ] 49 anti-threes \underbrace{[7000,7009]}_{\text{2 anti-threes: }\{7005, 7008\}}\quad\underbrace{[7010,7039]}_{\text{0 anti-threes}}\color{#D61F06}\quad\underbrace{[7040,7069]}_{\text{7 anti-threes}}\color{#D61F06}\quad\underbrace{[7070,7099]}_{\text{7 anti-threes}}\color{#333333}\quad\underbrace{[7100,7399]}_{\text{0 anti-threes}}\color{#EC7300}\quad\underbrace{[7400,7699]}_{\text{49 anti-threes}}\color{#EC7300}\quad\underbrace{[7700,7999]}_{\text{49 anti-threes}}

(Apply (1) to red intervals, (2) to orange intervals, and (3) to green intervals)

We see that there are 571 571 anti-threes from 1 to 7999. From 1 to 7999, the number of integers that don't contain 1 1 , 2 2 or 3 3 is 5 × 7 3 1 = 1714 5\times7^3-1=1714 (Why? Consider a 4-digit sequence \square\square\square\square , 0001 represents 1, 0002 represents 2 and so on, we choose digits for the 4 places. Since we can't use 1 1 , 2 2 , or 3 3 , we are left with 7 digits to choose for the last 3 places. For the first place, we can only use the digits 0 0 , 4 4 , 5 5 , 6 6 and 7 7 . We also subtracted 1 1 at the end to exclude 0000). Out of these 1714 1714 numbers that don't contain 1 1 , 2 2 , 3 3 , 571 571 of them are multiples of 3 ( anti-threes ), and 1714 571 = 1143 1714-571=1143 of them are not multiples of 3 (which is what we're looking for).

We now know that a 1 a_1 to a 1143 a_{1143} are all in 1 to 7999, hence we can trace the next term in the sequence a 1144 = 8000 a_{1144}=8000 . Continuing the sequence, a 1145 = 8005 a 1146 = 8006 a 1147 = 8008 a 1148 = 8009 a 1149 = 8044 a 1150 = 8045 a 1151 = 8047 a 1152 = 8048 a 1153 = 8050 a_{1145}=8005 \\ a_{1146}=8006 \\ a_{1147}=8008 \\ a_{1148}=8009 \\ a_{1149}=8044 \\ a_{1150}=8045 \\ a_{1151}=8047 \\ a_{1152}=8048 \\ a_{1153}=8050

We have found our answer, a 1153 = 8050 a_{1153}=8050 .

By the way, you might wonder how did I know to consider 1 to 7999. If you've solved Number Discrimination 2 , you'll know that a 1 a_1 to a 1600 a_{1600} are all in 1 to 9999, and a 1153 a_{1153} is somewhat closer to a 1600 = 9998 a_{1600}=9998 , we can guess that a 1153 a_{1153} is somewhere between 7000 and 9998.

If you however didn't solve that other problem, well, there's always trial and error. :P

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...