Clearly, a prime fits the criteria if the result of $\sqrt{24x+1}$ is an integer. By trial and error, I have found that seemingly the only primes to fit this criteria are 2, 5 and 7. How would I go about proving that they are the only ones (or, alternatively, that $x$ must be below a certain value and the only primes below this value that fit the criteria are 2, 5 and 7)?

I've gotten as far as stating that for some integer $a$:

$24x + 1 = a^2$

Then, I rearranged this to give:

$ 24x = a^2 - 1\\ 24x = (a+1)(a-1) $

I'm not quite sure where to go from here in order to complete the proof that $x$ cannot be above a certain value. Any help would be much appreciated! I'd prefer hints on where to go next rather than full solutions since I'd much rather reach the full solution myself.

  • $\begingroup$ $x$ is a prime and divides $(a+1)(a-1)$ by your last equality. Therefore ... HTH, AB, $\endgroup$
    – martini
    Mar 7, 2012 at 14:38
  • 1
    $\begingroup$ @martin HTH, AB? $\endgroup$
    – GeoffDS
    Mar 7, 2012 at 14:39
  • $\begingroup$ @Graphth: For HTH see en.wikipedia.org/wiki/HTH, AB is short for "Allzeit bereit" which is a German variant of "Be prepared" (en.wikipedia.org/wiki/Scout_Motto), AB, martini. $\endgroup$
    – martini
    Mar 7, 2012 at 14:44
  • $\begingroup$ You are very much on the right track. You might want to suppose that $x >7$ and try to derive a contradiction. You might also use the fact that $x$ can't divide both $a+1$ and $a-1$ if $x >7.$ $\endgroup$ Mar 7, 2012 at 14:45
  • $\begingroup$ For an approach with lots of writing and little thinking, try just writing out all the possible factorizations of $24x$ into two integers (remember $x$ is prime, so there aren't many) and see what happens if you let one factor be $a+1$ and the other be $a-1$. $\endgroup$ Mar 7, 2012 at 16:25

1 Answer 1


Your approach leads to a solution. As a continuing reminder that $x$ is supposed to be prime, let's call it $p$. We have $$24p=(a-1)(a+1).$$ Since $p$ divides the left-hand side, $p$ divides the right-hand side. It follows that (i) $p$ divides $a-1$ or (ii) $p$ divides $a+1$. (We are not excluding the possibility that $p$ divides both.)

Case (i): Suppose that $p$ divides $a-1$. Then $a-1=pk$ for some integer $k$. It follows that $a+1=pk+2$, and therefore $$24p=(pk)(pk+2).$$ By cancellation, we conclude that $$24=k(pk+2).$$ Now case (i) is in principle finished. We must have $pk+2 \le 24$, so $pk \le 22$. In particular, $p \le 19$, so it is a question of checking a small number of possibilities. The checking can be done efficiently, or not so efficiently.

Case (ii): It's your turn!

  • $\begingroup$ Thank you very much, I see it now! $\endgroup$
    – EdoDodo
    Mar 8, 2012 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .