# Two numbers that cannot both be squares

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).

• 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?
– 5xum
Aug 4, 2015 at 13:26
• 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. Aug 4, 2015 at 13:38
• 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 Aug 4, 2015 at 16:55

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)$.
• Didn't expect that $a+b^2$ in this case cannot be an square at all. Aug 4, 2015 at 14:03
• 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. Aug 4, 2015 at 14:09
• 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. Aug 4, 2015 at 17:01
• @GarethMcCaughan You can make the symbol $\ge$ by typing \ge. Aug 4, 2015 at 22:34