# Find the remainder when 20!45 is divided by 23.

40 views
in Aptitude
closed

Find the remainder when

20!45 is divided by 23.
1. 1
2. 22
3. 11
4. 20

by (46.1k points)
selected

Correct Answer - Option 3 : 11

Calculation:

Wilson's theorem states that for any prime number 'p', (p-1)! divided by p leaves a remainder of p – 1

⇒ Which can also be written as, (p - 1)! = (p - 1)! mod (p)

⇒ According to Wilson's theorem, when 22! is divided by 23, Remainder will be 22.

⇒ or we can write as, 22! = 22 mod (23)

⇒ 22! = 22 mod (23)

⇒ 22 x 21 x 20! = 22 mod (23)

⇒ -1 x -2 x 20! = 22 mod (23)

⇒ 20! = 11 mod (23)

⇒ Now, the question has been reduced to 1145/23

⇒ (1122 x 1122 x 11)/23 = 11 [As Remainder will be 1 when 1122 is divided by 23 By Fermat’s little theorem]

⇒ Wilson's theorem states that for any prime number 'p', (p-1)! divided by p leaves a remainder of p – 1

⇒ Which can also be written as, (p - 1)! = (p - 1)! mod (p)

⇒ Fermat’s little theorem states that if p is a prime number, then for any integer a, the number a p – a is an integer multiple of p.

⇒ Here p is a prime number

⇒ ap = a (mod p).

⇒ Special Case: If a is not divisible by p, Fermat’s little theorem is equivalent to the statement that a p - 1 - 1 is an integer multiple of p.

⇒ ap-1 = 1 (mod p)  OR ap-1/p = 1

⇒ Here a is not divisible by p.