2

Find the remainder when $22!$ is divided by $43$.

My attempt: I started off by applying Wilson Theorem,

$42! = -1 \pmod {43}$

$(42 \cdot 41 \cdot 40 \cdot \ldots \cdot 23) \cdot 22! = -1 \pmod {43}$

$20! \cdot 22! = -1 \pmod {43}$

How to solve it further?

Vasu Gupta
  • 1,090
  • 3
  • 12

1 Answers1

1

Split into prime factors:

$1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 \cdot 7 \cdot (4 \cdot 2) \cdot (3 \cdot 3) \cdot 10$

Group $(1,2,22), (3,14), (4,13), (5), (6,7), (4,10), (2,21), (3,15),(3)\equiv$

$1,-1,9,5,-1,-3,-1,2,3$ whose product is $ -7 \mod 43$.

There is $11,12,16,17,18,19,20$ leftover: $ 11 \cdot(3 \cdot 2 \cdot 2) \cdot (4 \cdot 2 \cdot 2) \cdot 17 \cdot 18 \cdot 19 \cdot 20$

Group $(11,2,2), (3,17), (18,2), (19, 2), (4,20) = 44,51,36,38, -6 \equiv 1,8, -7, -5, -6$ whose product is $-3 \mod 43$.

By multiplying these products, we get that $22!\equiv -7 \cdot -3 \equiv 21 \mod 43$.

Derek Luna
  • 2,869