  In this paper, we study partitions of positive integers with restrictions
involving squares. We mainly establish the following two results (which were
conjectured by Sun in 2013):
  (i) Each positive integer $n$ can be written as $n=x+y+z$ with $x,y,z$
positive integers such that $x^2+y^2+z^2$ is a square, unless $n$ has the form
$n=2^{a}3^{b}$ or $2^{a}7$ with $a$ and $b$ nonnegative integers.
  (ii) Each integer $n>7$ with $n\not=11,14,17$ can be written as $n=x+y+2z$
with $x,y,z$ positive integers such that $x^2+y^2+2z^2$ is a square.
