### Final Exams Again

#### Posted by John Baez

I’m busy grading final exams for my undergraduate number theory class. The class went quite well — perhaps because instead of proving quadratic reciprocity, I spent time teaching them about arithmetic functions, Dirichlet convolution, Möbius inversion and the like… topics which lead to lots of fun puzzles and computations.

Nonetheless, grading finals is always mind-numbing and dispiriting. I’m sure you’ve seen it — perfectly intelligent people grading finals, trading the most mean-spirited and witless of witticisms just to keep from going insane.

In that spirit, let me report three mildly amusing things I’ve seen so far. Don’t get your hopes up — they’re not nearly as funny as the proof of the infinitude of primes that I described last time I taught this class.

Indeed, I’m sure some of you have seen funnier final exams this year. If so, tell us about ‘em!

One student said that the Fundamental Theorem of Arithmetic stated that any counting number could be uniquely factored into a product of powers of ‘distant’ primes.

Okay, not that funny.

Another question said: “Exactly one of these number is prime:

$77577$ $77777$ $77977$

Which one is it?” And one student answered: “$77977$, because the sum of the digits is prime”.

That’s a bit more funny after you solve the problem yourself.

Finally, a quite good student got tripped up on this question: what is $1000!$ mod $1000$?

Of course the answer is $0$.

And of course the *dumb* way to get tripped up was to attempt to use Wilson’s Theorem, which says that $(p-1)! = -1$mod $p$ when $p$ is prime. That’s for people who try to solve any problem by grasping for the nearest available theorem, whether it applies or not.

But here’s a more interesting way to get tripped up. $1000 = 0$ mod $1000$, so $1000! = 0! = 1$ mod $1000$.

Okay, back to grading. Sorry for the interruption.

## Re: Final Exams Again

Not a funny final exam answer, but related to factorials and mod: if we could compute $(\sqrt{n})! \mod n$ quickly, then we could factor large numbers quickly.