There was a brainteaser in the Science Magazine from University of Hong Kong which is as follow:
Find all the prime numbers $p$ such that $\sqrt{\frac{p+7}{9p-1}}$ is rational.
I tried a few numbers and it seems to suggest that $11$ is a suitable candidate.
Can I know the techniques to approach this question?
Thank you.
The fact that $p$ is prime is something of a red herring.
Suppose that $$\sqrt{\frac{x+7}{9x-1}}$$ is rational for some positive integer $x$.
Then for some positive integers $k$, $a$, and $b$, we have the equations $$x+7=ka^2$$ and $$9x-1=kb^2$$
Multiplying the first equation by $9$ and subtracting the second equation from it, we get $$64=k(9a^2-b^2)=k(3a-b)(3a+b)$$
Now each of $k$, $3a-b$, and $3a+b$ is a positive factor of $64$. As a reminder, $64$ has seven positive factors: $1$, $2$, $4$, $8$, $16$, $32$, and $64$.
Note that the terms $3a-b$ and $3a+b$ add up to be $6a$, so the sum of these terms must be divisible by $6$. Using this criteria, we can quickly reduce the possible pairs $(3a-b,3a+b)$ to $(2,4)$, $(2,16)$, $(2,64)$, $(4,8)$, $(4,32)$, $(8,16)$, $(8,64)$, and $(16,32)$. However, the products of these pairs is greater than $64$ in all cases except $(2,4)$, $(2,16)$, and $(4,8)$.
Now, solving the resulting equations for $k$, $a$, and $b$, we get the possible solutions $(k,a,b)$ as $(8,1,1)$, $(2,3,7)$, and $(2,2,2)$. These then correspond to solutions for $x$ (we use here $x=ka^2-7$) - giving us $x=8-7=1$, $x=18-7=11$, and $x=8-7=1$. Hence the only positive integers which make $$\sqrt{\frac{x+7}{9x-1}}$$ rational are $1$ and $11$.
Finally, since we are asked for all prime solutions, we have the only solution as $p=11$.