Find the remainder when $99!+99$ is divided by $100$
I think I'm suppose to use either Wilson's or Fermat's theorem however, both 99 and 100 are not prime numbers so I can't use their formulas
Find the remainder when $99!+99$ is divided by $100$
I think I'm suppose to use either Wilson's or Fermat's theorem however, both 99 and 100 are not prime numbers so I can't use their formulas
On
$99! = 1*\color{red}2*3*4*.....*47*48*49*\color{red}{50}*51*....* 99$ so .......
$100|99!$
So $99! + 99 \equiv 99 \pmod {100}$.
=====
Note: Wilson theorem is powerful if $n$ is prime. But if $n$ is not prime the equivalent is ... stupid.
If $n = j*k$ and $j< k$ then $(n-1)! = \prod_{m<n} m = (jk)*\prod_{m< n; m\ne j; n\ne k} m$ so $(n-1)! \equiv 0 \pmod n$.
And if $n = p^2$ where $p> 2$ is prime. Then $(n-1)! = \prod_{m<n} m = 2p^2*\prod_{m< n; m\ne p; m\ne 2p} m$ so $(n-1)! \equiv 0 \pmod n$.
If if $n = 4$ then well, then we have $3! = 6\equiv 2 \pmod 4$ but that's a single case.
$(n-1)! \equiv 0 \pmod n$ unless $n$ is prime, in which case you have Wilson's Th. or $n= 4$ in which case $3! \equiv 2 \pmod 4$.
It's ... that easy.
hint-- $99!$ is $0$ mod $100.$