# Prove two numbers are coprime

I encountered some other problem and I found a beautiful proof here Write $1/1 + 1/2 + ...1/ (p-1)=a/b$ with $(a,b)=1$. Show that $p^2 \mid a$ if $p\geq 5$. (see Thomas Andrew's post)

But I thought he may miss the proof that $$(a_1,(p-1)!)=1,$$ which is not trivial for me. (As for the definitions of $$a_1$$ and $$p$$ please see the link above. The definitions are simple and clear there.)

My problem is just that how to prove $$(a_1,(p-1)!)=1$$.

I tried to use the property that $$(n,m)=(n.n+km)$$ for any integers $$n,m,k.$$ But it turns out it makes the expression messy and dirty. And I can't go further.

Any help will be thanked.

• Would you mind explaining why should we prove $\gcd(a_1,(p-1)!)=1$ in this one you posted? – Oolong milk tea May 11 at 6:29
• @Oolongmilktea I found that they are not necessarily coprime. And with the explanations of Tarit and awllower, I am clear now. – maths learner May 11 at 8:06

It is not neceassary to have $$\text{gcd}(a_1,(p-1)!)= 1$$. From Vieta's formula, in $$f(x)$$, coeff. of $$x$$ is sum of all products of $$(p-2)$$ roots of $$f(x)$$ choosen at a time. $$a_1=2\cdot3\cdots(p-1)+1\cdot 3\cdot \cdots(p-1)+\cdots +1\cdot 2\cdots (p-2)\\ =(p-1)!\big(1+\frac{1}{2}+\frac13+\cdots + \frac1{p-1}\big)$$

hence, the required sum is equal to $$\frac{a_1}{(p-1)!}$$ If some common factors between $$a_1$$ and $$(p-1)!$$ cancels out, then also $$p^2|a_1$$, as all terms of $$a_1$$ contains products of numbers below $$p$$.

• Oh yea, the crucial fact is that $(p-1)!$ doesn't have a factor as $p$. Thanks! – maths learner May 11 at 8:03

By definition $$a_1=\sum_{n=1}^{p-1}(\prod_{m\ne n}m).$$ So in fact $$a_1$$ and $$(p-1)!$$ need not be co-prime (for $$p=7$$, we have $$a_1=1764$$ and $$(p-1)!$$ is even). The proof in the linked question only requires that $$p$$ does not divide $$(p-1)!$$, which is clear: $$(p-1)!$$ is divisible only by primes $$.

P.S. In case you are wondering why the proof only requires that $$p$$ does not divide $$(p-1)!$$, notice that we can reduce the fraction $$\frac{a_1}{(p-1)!}$$ to the lowest terms $$\frac ab$$, where $$a=\frac{a_1}{\gcd(a_1,(p-1)!)}$$. Since $$p$$ does not divide $$(p-1)!$$, $$\frac{a_1}{\gcd(a_1,(p-1)!)}$$is divisible by $$p^2$$, hence concluding the proof.

Hope this helps.

• Thank you so much!! It does help. I think @tarit's post is simpler so I took his post as an answer. But your post is very systematic and helpful. :) – maths learner May 11 at 8:03