0

I encountered following math problem I could use some help with. How can I prove that $$\sum_{k=1}^{18}{\frac{18!}{k}}\equiv 0 \pmod {19}$$

I have tried already: $$\sum_{k=1}^{18}{\frac{18!}{k}}= 18!\bullet \sum_{k=1}^{18}{\frac{1}{k}}$$

And using Wilson’s theorem with $p=19$ I get:

$$\sum_{k=1}^{18}{\frac{18!}{k}}\equiv\left(\sum_{k=1}^{18}{\frac{1}{k}}\right)\bullet(-1) \pmod {19}$$ But this is then: $$\neq 0 \pmod {19}$$

Where did I exactly go wrong? Thank you already in advance for your help.

Bill Dubuque
  • 272,048
T_B
  • 155
  • 2
    The $18!$ is irrelevant (it just cancels out), and every element $\pmod {19}$ has a unique additive inverse (not equal to itself). – lulu Jan 06 '23 at 21:50
  • 1
    Why is the sum over $1/k$ (considered as an inverse mod $19$) nonzero? Consider the shorter computation mod $3$ or $5$. – anomaly Jan 06 '23 at 21:54
  • 1
    Another proof can be that $p(x)=\prod_{k=1}^{18}(x-k)-x^{18}+1$ has degree $17$. By Fermat's little theorem, and since $19$ is prime, all the $18$ numbers $1,2,...,18$ are roots. Since $19$ is prime, then all its coefficients must be zero modulo $19$. One of its coefficients is your sum. The coefficient of the linear term. Incidentally, this is also one of the ways to prove one direction of Wilson's theorem. which is the statement that the constant coefficient is zero modulo $19$. – plop Jan 06 '23 at 22:03
  • 2
    @lulu It isn't completely irrelevant if you mean that $18!/k$ is the integer $18!/k$ rather that the class $18!\cdot k^{-1}$ modulo $19$, but in this case it's all the same. – Sassatelli Giulio Jan 06 '23 at 22:03
  • Special case of Gauss / Wilson reflection in the linked dupe since $,f(n) := n^{-1},$ is an odd function. $\ \ $ – Bill Dubuque Jan 06 '23 at 22:46

2 Answers2

4

You're close; since 19 is prime, each $k$ has a unique multiplicative inverse. Thus, we have that $$\sum_{k=1}^{18} \frac{1}{k} = \sum_{k=1}^{18} k \pmod{19}.$$ This should finish off the proof.

Alan Chung
  • 1,182
  • So do you mean that: $$\sum_{k=1}^{18}{\frac{18!}{k}}\equiv\left(\sum_{k=1}^{18}{\frac{1}{k}}\right)\bullet(-1) \pmod {19}\equiv - \sum_{k=1}^{18}{\frac{1}{k} \pmod{19}\equiv \sum_{k=1}^{18}{k}\pmod{19}\equiv 0\pmod{19}$$ did I get that right? – T_B Jan 06 '23 at 22:33
  • 1
    Yup! That's what I meant – Alan Chung Jan 07 '23 at 00:47
2

Notice that for any $k=1,\dots,9$, $$ \frac{1}{k}+\frac{1}{19-k}=\frac{19}{k(19-k)}, $$ so $$ \sum_{k=1}^{18}\frac{1}{k}=\sum_{k=1}^{9}\frac{19}{k(19-k)}. $$ And since $19$ is prime, it does not cancel with any factor in the denominator.