Page 1 of 1

Remainder

Posted: January 18th, 2021, 11:42 am
by cinelli
A mathematical challenge.

What is the remainder when 2021 factorial is divided by 2017 squared? And what is the connection between your answer and the Grand National?

Cinelli

Re: Remainder

Posted: January 18th, 2021, 4:24 pm
by Gengulphus
cinelli wrote:A mathematical challenge.

What is the remainder when 2021 factorial is divided by 2017 squared? ...

A spoiler for that part, though it includes a reference to a mathematical theorem that I'm not going to try to prove here - look it up on Wikipedia and research the mathematics used there if you feel you need to know full details!

Taking out the common factor 2017, and using the expression x rmdr y for the positive remainder of x when divided by y:

(2021!) rmdr (2017^2) = 2017 * ((2016! * 2018 * 2019 * 2020 * 2021) rmdr 2017)

= (((2016!) rmdr 2017) * (2018 rmdr 2017) * (2019 rmdr 2017) * (2020 rmdr 2017) * (2021 rmdr 2017)) rmdr 2017

= (((2016!) rmdr 2017) * 1 * 2 * 3 * 4) rmdr 2017

= (24 * ((2016!) rmdr 2017)) rmdr 2017

2017 is prime, which allows me to use Wilson's theorem, which says that (p-1)! is congruent to -1 modulo p for any prime p (i.e. p divides the difference between (p-1)! and -1). That implies that it's also congruent to p-1 modulo p, so (2016!) rmdr 2017 = 2016, and so the answer is (24 * 2016) mod 2017 = 1993.

cinelli wrote:... And what is the connection between your answer and the Grand National?

And a spoiler for that part as well, though obtained by guessing and checking my guess is correct - my knowledge of the Grand National was almost non-existent (and only slightly better now!):

It seemed likely that there was something special about the 1993 Grand National, and looking up "1993 Grand National" on Wikipedia confirms that guess: 1993 was the year that the Grand National was declared void.

Gengulphus

Re: Remainder

Posted: January 20th, 2021, 11:47 am
by cinelli
Reply to spoiler.

Well solved, Gengulphus. An elegant solution. This is a problem set by Michael Penn and is, I think, a nice use of Wilson's theorem.

1993 was the year when they bungled the start of the Grand National. A few horses completed the course but the result didn't count. The Wikipedia article goes into extraordinary detail.


Cinelli