I was wondering where to start with the following question:

Show for $a,b \in \mathbb{N}$ that $a+b^2$ and $a^2+b$ cannot be both squares.

Here $\mathbb{N}$ is the positive integers ($0$ not included).

  • 1
    $\begingroup$ Hi and welcome to the site! Since this is a site that encourages and helps with learning, it is best if you show your own ideas and efforts in solving the question. Can you edit your question to add your thoughts and ideas about it? $\endgroup$
    – 5xum
    Aug 4, 2015 at 13:26
  • 1
    $\begingroup$ Actually, I really don't know where to start. I've been writing them as equations $a+b^2 = n^2$ and $a^2+b=m^2$ for natural numbers $m$ and $n$. Been subtracting those equations and dividing and manipulating them, but I've no clue where I'm heading. $\endgroup$
    – peterhhh
    Aug 4, 2015 at 13:38
  • 1
    $\begingroup$ It's a pretty old problem. Formulated in the book of Diophantus. 4 the book. Task 20. The formula for the General case in the link. artofproblemsolving.com/community/c3046h1046718__4 $\endgroup$
    – individ
    Aug 4, 2015 at 16:55

1 Answer 1


Consider $a < b$:

Clearly, $b^2 < a+b^2$. Further, we see that $$ a+b^2 < b + b^2 = b(b+1) < (b+1)^2 $$ Hence, $b^2 < a+b^2 < (b+1)^2$. Thus, $a+b^2$ is not a square. On the other hand, $a^2+b$ may be a square, depending on the choice of $a$ and $b$.

If we have $a=b$, then neither $a^2+b$ nor $a+b^2$ are squares, as they would both simplify to $a(a+1)$.

  • $\begingroup$ Didn't expect that $a+b^2$ in this case cannot be an square at all. $\endgroup$
    – peterhhh
    Aug 4, 2015 at 14:03
  • $\begingroup$ If $a\le b$, then $a+b^2$ cannot be a square, if $b\le a$, then $a^2+b$ cannot be a square. Mihir just proved you that they cannot be squres for the same values of $a$ and $b$, but also showed in what domains each one of the conditions are verified. Great job. $\endgroup$
    – BusyAnt
    Aug 4, 2015 at 14:09
  • 3
    $\begingroup$ May I offer a slight rephrasing of Mihir's proof? The next square after $b^2$ is $b^2+2b+1$, so if $a>0$ and $b^2+a$ is a square then $a >= 2b+1$. Similarly, if $b>0$ and $a^2+b$ is a square then $b >= 2a+1$. But plainly we cannot have both $a >= 2b+1$ and $b >= 2a+1$, and we're done. $\endgroup$ Aug 4, 2015 at 17:01
  • $\begingroup$ @GarethMcCaughan You can make the symbol $\ge$ by typing \ge. $\endgroup$ Aug 4, 2015 at 22:34
  • $\begingroup$ D'oh, so I can. Apologies for the ugliness. $\endgroup$ Aug 10, 2015 at 16:44

You must log in to answer this question.

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