You happen to visit a school. You meet the maths teacher of the school and ask her for the total number of enrollments in the past years. The maths teacher doesn't know what exactly it is but quite evasively leaves you with a puzzle that she's sure that you can never solve. The puzzle is as follows: To have an equal number of students in a classroom, they tried grouping them in a size of students. To their irritation, they found that students are left in each case. She then asks you to find the least number of enrollments with which such a scenario is possible. Will you outsmart her??
Note -Enter you answer according to the question.
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.
You want to solve this:
x ≡ 1 2 ( m o d 7 1 ) x ≡ 2 6 ( m o d 7 3 ) x ≡ 3 4 ( m o d 7 5 ) x ≡ 5 9 ( m o d 7 7 )
Compute M = 7 1 × 7 3 × 7 5 × 7 7
Compute M i = m i M for each modulus m i
You'll get ( M 1 , M 2 , M 3 , M 4 ) = ( 4 2 1 5 7 5 , 4 1 0 0 2 5 , 3 9 9 0 1 , 3 8 8 7 2 5 )
Compute x i ≡ M i − 1 ( m o d m i ) for each m i using Extended Euclidean Algorithm .
You'll get ( x 1 , x 2 , x 3 , x 4 ) = ( 3 7 , 4 1 , 6 1 , 8 )
We are ready! Thank the stars!
Compute x ≡ i = 1 ∑ 4 m i M i x i ( m o d M )
You'll get x ≡ 1 9 1 4 0 3 3 4 ( m o d 2 9 9 3 1 8 2 5 )
which is obviously the smallest possible solution.
Why care, anyway?
Go to Wolfram|Alpha and run this code: