TITLE: Help with a proof of a special case of Dirichlet's Theorem
QUESTION [5 upvotes]: So I am reading through a proof of a special case of Dirichlet's theorem on arithmetic progressions, specifically a proof that if $p$ is prime, then there are infinitely many primes congruent to $1$ mod $p$ (Link Here). 
In it, they assume there are a finite number of such primes, enumerated as $p_1,p_2,\ldots,p_n$, and they define the number:
$$ a=p\prod_{i=1}^n p_i$$
They prove that $p \mid \phi(a^p-1)$, and they state that (clearly) $a^p-1$ is not divisible by $p$.
Then they use those two facts to claim that at least one prime factor of $a^p-1$ must be congruent to $1$ mod $p$. This is the step that I am not understanding; how do those two facts imply that at least one of its prime factors must be congruent to $1$ mod $p$?

REPLY [3 votes]: suppose 
$$
a^p-1 = \prod_j q_j^{r_j+1}
$$
with $r_j \ge 0$
then
$$
\phi(a^p-1)= \prod_jq_j^{r_j}\prod(q_r-1)
$$
so for some $r$ we have $p|(q_r-1)$ which implies $q_r \equiv_p 1$