Prime solutions of an equation I am trying to find out if there are any prime solutions to the equation $24p + 1 = q^2$ except $(2,7)$, $(5,11)$ and $(7,13)$. I have no idea how to approach this. I've run some brute force calculations and nothing turns up, but of course that's not a proof.
 A: $(q-1)(q+1) = q^2 - 1 = 24p.$
Factors of $(24)$ are the set $S = \{1,2,3,4,6,8,12,24\}.$
Assume that $p$ is relatively prime to $(24)$.
Since $p$ is a prime, $p > 2 \implies$ at least one of $(q-1), (q+1)$ is relatively prime to $p$ which implies that at least one of $(q-1)(q+1)$ must be in $S$.
Therefore, therefore $q$ can not be greater than $25$.
Alternatively, if $p$ is not relatively prime to $(24)$, then either $p=2$ or $p=3$.  These cases can be checked manually.
A: For showing a limit on solutions, consider the formlation of $24p=q^2-1 = (q+1)(q-1)$
Then both $(q+1)$ and $(q-1)$ must be even, and one will be divisible by $2p$. However this gives the remaining factor as no more than $12$, so $2p \leq 12+2$ and $p$ can be no bigger than $14/2 = 7$.
Once this is established, the full set of solutions you found can be obtained by evaluating  $p\in \{2,3,5,7\}$.
A: We have $24p+1=q^2$. This gives us $$24p=q^2-1\space  \text{or} \space 24p=(q-1)(q+1)$$
Observe that this means $p|(q-1)(q+1)$. Since the difference between $q-1$ and $q+1$ is $2$,either $p|(q-1)$ or $p|(q+1)$ (assuming $p>2$)
This gives us two cases:
Case I: $p|(q-1)$
This gives us $\exists k\in \mathbb Z:kp=q-1$, thus $q+1=kp+2$
So We have $$24p=kp(kp+2)\space \text{or}\space 24=k(kp+2)$$
We can now simply check all the factors of $24$.
this gives us $(5,11)$ as the only solution for this equation in form of $(p,q)$ at $k=2$
Case II: $p|(q+1)$
This gives us $\exists k\in \mathbb Z:kp=q+1$, thus $q-1=kp-2$
So We have $$24p=kp(kp-2)\space \text{or}\space 24=k(kp-2)$$
We can now simply check all the factors of $24$.
this gives us $(7,13)$ as the only solution for this equation in form of $(p,q)$ at $k=2$
Adding in the case when $p=2$, thus giving another solution $(2,7)$.
$\therefore (2,7),\space (5,11),\space (7,13)$ are the only solutions for the given equation.
