8.2. Find all prime numbers $p$ for which $8 p+1$ is: a) a perfect square? b) a perfect cube
Answer a) $p=3$; b) such $p$ does not exist. Solution. a) The equation $8 p+1=n^{2}$ is not satisfied by $p=2$, and thus $p$ is odd. Write the equation in the form $(n-1)(n+1)=8 p$. The number on the right side has the following natural divisors: $1,2,4,8, p, 2 p, 4 p, 8 p$. The factors on the left side differ by 2 and are therefore both even. Thus, only two pairs of factors need to be checked: $(2 ; 4 p)$ and $(4 ; 2 p)$. The first pair does not work upon checking (since $4 p-2>2$). The second pair gives the solution $n=5, p=3$. b) Write the equation in the form $(n-1)\left(n^{2}+n+1\right)=8 p$. The factor on the left side $n^{2}+n+1-$ is an odd number $>1$ for any $n$ and therefore (since $p=2$ does not work) the pair of factors on the left side can only be one, namely $(8 ; p)$. Then $n=9$ and $p=91$, but $91-$ is a composite number (it is divisible by 7) and therefore the sought $p$ does not exist.