## Integers(x,y,z) such that (xy+x+y),(yz+y+z),(zx+z+x) are all squares

Book III Diophantus Arithmetica:

To find integers   $(x, y, z)$   such that

$x y \; + \; x \; + \; y$
$y z \; + \; y \; + \; z$
$z x \; + \; z \; + \; x$
$x y \; + \; z$
$x z \; + \; y$
$y z \; + \; x$

are all squares

Solution:

$x \; = \; n^2$,          $y \; = \; (n + 1)^2$,          $z \; = \; 4(n^2 + n + 1)$

Indeed,

$x y \; + \; x \; + \; y$
$= \; n^2((n + 1)^2) \; + \; n^2 \; + \; (n + 1)^2$
$= \; n^4+2 n^3+3 n^2+2 n+1$
$= \; (n^2+n+1)^2$

$y z \; + \; y \; + \; z$
$= \; (n + 1)^2(4(n^2 + n + 1)) \; + \; (n + 1)^2 \; + \; 4(n^2 + n + 1)$
$= \; 4 n^4+12 n^3+21 n^2+18 n+9$
$= \; (2 n^2+3 n+3)^2$

$z x \; + \; z \; + \; x$
$= \; (4(n^2 + n + 1))n^2 + 4(n^2 + n + 1) \; + \; n^2$
$= \; 4 n^4+4 n^3+9 n^2+4 n+4$
$= \; (2 n^2+n+2)^2$

$x y \; + \; z$
$= \; n^2(n + 1)^2 \; + \; 4(n^2 + n + 1)$
$= \; n^4+2 n^3+5 n^2+4 n+4$
$= \; (n^2+n+2)^2$

$x z \; + \; y$
$= \; n^2(4(n^2 + n + 1)) \; + \; (n + 1)^2$
$= \; 4 n^4+4 n^3+5 n^2+2 n+1$
$= \; (2 n^2+n+1)^2$

$y z \; + \; x$
$= \; (n + 1)^2(4(n^2 + n + 1)) \; + \; n^2$
$= \; 4 n^4+12 n^3+17 n^2+12 n+4$
$= \; (2 n^2+3 n+2)^2$

$x y \; + \; y z \; + \; z x$
$= \; n^2(n + 1)^2 \; + \; (n + 1)^2(4(n^2 + n + 1)) \; + \; n^2(4(n^2 + n + 1))$
$= \; 9 n^4+18 n^3+21 n^2+12 n+4$
$= \; (3 n^2+3 n+2)^2$