Hi, I've been asked a question regarding Wilsons Theorem and having trouble wrapping my head around it.

The question is:

Show that 36 × 27! + 25 is divisible by 31 and confirm your answer using Wilson’s Theorem.

I've worked out:

36 x 27! = 391999300215060677787648000000

+ 25 = 391999300215060677787648000025

/ 31 = 12645138716614860573795096775

However this doesn't cover the thorem i assume? Any help would be appreciated. Thanks.

Guest Apr 25, 2015

#4**+5 **

Alan is much too polite.

Consider the number

$$\displaystyle N=30.29.28.(36.27!+25)=36.30!+30.29.28.25$$

Working mod 31,

$$\displaystyle 36\equiv5,\quad \text{and}\quad 30!\equiv -1,$$

( the second of those being Wilson's theorem with p = 31, )

so, multiplying,

$$\displaystyle 36.30! \equiv 5.(-1)=-5.\quad ...........(1)$$

Also,

$$30 \equiv (-1), \: 29 \equiv (-2), \: 28\equiv (-3)\: \text{and}\: 25\equiv (-6),$$

so, again multiplying,

$$\displaystyle 30.29.28.25\equiv (-1).(-2).(-3).(-6)=36\equiv 5.\quad ...............(2)$$

Adding (1) and (2),

$$\displaystyle N\equiv -5+5\equiv 0,$$

which says that N is divisible by 31.

Looking back at the definition of N, since 30.29.28 is not divisible by 31 (which is prime), it follows that the expression within the brackets must be divisible by 31.

Bertie May 12, 2015

#1**+5 **

Wilson's theorem says that, if p is a prime number, then (p-1)! = -1mod(p)

However, I haven't been able to see how to use it to prove that 36*27! + 25 is divisible by 31.

.

Alan May 11, 2015

#2**+5 **

Also answered here by Mathcad

http://web2.0calc.com/questions/past-question-on-wilson-s-theorem

**Mathcad's answer.**

One last attempt at posting this.The software on this system is hopeless.

We can write 36x27!+25 as (36x31!+(31x30x29x28)x25)/31x30x29x28 and can now factor out 31 from the numerator.So the expression is divisible by 31 and we can write

36x27!+25=31n for some n.

then,to use Wilson,we can write 36x27!+25=31!n/30! and since 31!=30mod 31 ,rearrange to get

n=30!(36x27!+25)/30modulo31 which is divisible by 31.

Melody May 11, 2015

#3**0 **

Mathcad, you might want to note that 31! = 0 mod(31) not 30 mod(31) (i.e. it is exactly divisible by 31).

Wilson's theorem says that 30! = 30 mod(31).

.

Alan May 11, 2015

#4**+5 **

Best Answer

Alan is much too polite.

Consider the number

$$\displaystyle N=30.29.28.(36.27!+25)=36.30!+30.29.28.25$$

Working mod 31,

$$\displaystyle 36\equiv5,\quad \text{and}\quad 30!\equiv -1,$$

( the second of those being Wilson's theorem with p = 31, )

so, multiplying,

$$\displaystyle 36.30! \equiv 5.(-1)=-5.\quad ...........(1)$$

Also,

$$30 \equiv (-1), \: 29 \equiv (-2), \: 28\equiv (-3)\: \text{and}\: 25\equiv (-6),$$

so, again multiplying,

$$\displaystyle 30.29.28.25\equiv (-1).(-2).(-3).(-6)=36\equiv 5.\quad ...............(2)$$

Adding (1) and (2),

$$\displaystyle N\equiv -5+5\equiv 0,$$

which says that N is divisible by 31.

Looking back at the definition of N, since 30.29.28 is not divisible by 31 (which is prime), it follows that the expression within the brackets must be divisible by 31.

Bertie May 12, 2015