Colter is a designated spy on a mission. His mission is to dismantle a suitcase bomb on a train to Chicago. In order to do that, he has to break The Source Code . The Source Code is a table with buttons labelled from 1 to in a snake-like fashion (see below for details). The code can be broken if and only if Colter has pushed all the button whose number satisfies the following conditions:
How many button numbers does Colter have to push in order to break The Source Code?
Clarifications :
Hint : Chinese remainder theorem is going to be useful in this.
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.
Suppose x lie in line n , ( 2 ≤ n ≤ 2 0 1 4 ) . We have:
a = 4 0 3 0 ( n − 1 ) + 1 − x and 4 0 3 0 ( n − 1 ) + 1 − x ≡ 1 ( m o d 2 )
c = 4 0 3 0 n − x + 1 and 4 0 3 0 n − x + 1 ≡ 3 ( m o d 4 )
⇒ x ≡ 0 ( m o d 2 ) and x ≡ 4 0 3 0 n − 2 ( m o d 4 )
For x in lines of desending order, we have m o d ( n , 2 ) = 0 ⇒ n ≡ 2 ( m o d 4 ) . We have:
m o d ( b , 3 ) = 2 ⇒ x ≡ 0 ( m o d 3 )
m o d ( d , 5 ) = 4 ⇒ x ≡ 3 ( m o d 5 )
By applying the Chinese remainder theorem, we have x ≡ 1 8 ( m o d 6 0 ) .
The number of the numbers 6 0 x + 1 8 in ( 2 0 1 7 , 4 0 2 9 ) ; ( 6 0 4 7 , 8 0 5 9 ) ; ( 1 0 0 7 7 , 1 2 0 8 9 ) ; ( 1 4 1 0 7 , 1 6 1 1 9 ) ; ( 1 8 1 3 7 , 2 0 1 4 9 ) ; ( 2 2 1 6 7 , 2 4 1 7 9 ) are 3 3 , 3 4 , 3 4 , 3 4 , 3 4 , 3 3 respectively.
For x in lines of asending order, we have m o d ( n , 2 ) = 1 ⇒ n ≡ 0 ( m o d 4 ) . We have:
m o d ( b , 3 ) = 2 ⇒ x ≡ 1 ( m o d 3 )
m o d ( d , 5 ) = 4 ⇒ x ≡ 0 ( m o d 5 )
By applying the Chinese remainder theorem, we have x ≡ 4 0 ( m o d 6 0 ) .
The number of the numbers 6 0 x + 4 0 in ( 4 0 3 2 , 6 0 4 4 ) ; ( 8 0 6 2 , 1 0 0 7 4 ) ; ( 1 2 0 9 2 , 1 4 1 0 4 ) ; ( 1 6 1 2 2 , 1 8 1 3 4 ) ; ( 2 0 1 5 2 , 2 2 1 6 4 ) ; ( 2 4 1 8 2 , 2 6 1 9 4 ) are 3 4 , 3 4 , 3 4 , 3 3 , 3 3 , 3 3 respectively.
Therefore, the number of numbers x is:
[ 6 1 0 0 8 . ( 3 3 . 2 + 3 4 . 4 ) − 3 3 ] + [ 6 1 0 0 8 . ( 3 3 . 3 + 3 4 . 2 ) − 3 3 . 2 ] = 6 7 6 0 5