1

I want to make sure I'm doing this right. This is what I'm trying to do: Let $p$ be an integer other than $0,\pm 1$ . Prove that p is prime if for each $a\in \Bbb Z$ either $(a,p)=1$ or $ p\mid a $ .

here's what I have so far:

First note that $(-m) \mid p$ if and only if $m \mid p$, so we may consider only positive divisors of $p$. By the same reasoning, $-p$ is prime if and only if $p$ is prime, so we may assume $p>1$. If $p \mid a$ then $(a,p)=p$. Thus either $(a,p)=1$ or $(a,p)=p$. Consider the set $\mathbf S$ of all positive divisors $m$ of $p$, that is $$ \mathbf S=\{ m\in \Bbb Z : m\gt 0 \text{ and } p=mn \text{ for some } n\in \Bbb Z\}. $$ Since $a$ may be any integer, suppose $a=m$, that is, suppose $a$ is a positive divisor of $p$. Then $(a,p)=(m,p)=m$. But we know that either $(a,p)=1$ or $(a,p)=p$. Hence either $m=1$ or $m=p$. Therefore the only divisors of $p$ are $\pm 1$ and $\pm p$, and hence $p$ is prime.

I'm a little bit confused about the justification for replacing $a$ with $m$.

  • Looks like a complete proof to me :) The replacing $a$ by $m$ is fine, because the question says that this particular property must be true for each $a\in\mathbb Z$, so it certainly must be true for $a=m$ a divisor of $p$. – jlammy Jan 24 '21 at 16:17
  • Thank you, probably by the time I typed it out, my confusion was mostly resolved. – Mu_Coffee Jan 24 '21 at 16:18

0 Answers0