Finding Prime Number I have to show that for any prime p , there are either infinitely many or no positive integer a , or no positive integer a so that 6p divides $ a^p+1 $ . I have to find all those primes for which there exists no solution . How can I solve this problem ?
 A: Firstly, note that by unique factorization, for any given $p\gt 3$, saying that $6p|a^p+1$ is the same as saying that $6|a^p+1$ and $p|a^p+1$ (the cases $p=2$ and $p=3$ should be considered separately - they're easy to do by hand).
Next, investigate the constraint that $p|a^p+1$: using F$\ell$T, we get $a^p\equiv a\bmod p$ and so $a^p+1\equiv a+1$.  It must be the case that $a+1\equiv 0\bmod p$, or in other words $a=kp-1$.  Contrariwise, if $a\equiv -1\bmod p$, then $a^p\equiv -1\bmod p$ (remember that this assuming $p$ is odd; we handled the case $p=2$ separately!) and so $p|a^p+1$.  Therefore, for any $p$ there are infinitely many $a$ with $p|a^p+1$ : all those with $a\equiv -1\bmod p$.
The other half is similarly straightforward: for $6$ to divide $a^p+1$ then clearly $a$ must be odd (i.e. $a\equiv 1\bmod 2$).  Furthermore, it must be the case that $a^p\equiv -1\bmod 3$; given that $p$ is odd, this is equivalent to saying that $a\equiv -1\bmod 3$.
Putting this all together, there are three conditions: $a\equiv -1\bmod p$, $a\equiv 1\bmod 2$, and $a\equiv -1\bmod 3$.  Now, you can use the Chinese Remainder Theorem to show that such an $a$ must exist for any $p\gt 3$, and in fact that infinitely many such $a$ exist: given some $a$ that satisfies the conditions, then $a+6kp$ does as well for any $k$.
A: Use Fermat Little Theorem ...
$ \frac{ a^p+1 }{6p} 
=(\frac{a^p}{6p} +\frac{1}{6p}) $
Now since $ 6p $ will never divide $ 1 $ and as per Fermat Little Theorem $ a^p=a(mod p) $
where p is prime . Therefore the first term is also not divisible , So no positive integer a exist for which 6p divides $ a^p+1 $.
