  The well-known Lagrange's four-square theorem states that any integer
$n\in\mathbb{N}=\{0,1,2,...\}$ can be written as the sum of four squares.
Recently, Z.-W. Sun investigated the representations of $n$ as
$x^2+y^2+z^2+w^2$ with certain linear restrictions involving the integer
variables $x,y,z,w$. In this paper, via the theory of quadratic forms, we
further study the representations $n=x^2+y^2+z^2+w^2$ (resp.,
$n=x^2+y^2+z^2+2w^2$) with certain linear restrictions involving primes. For
example, we obtain the following results:
  (i) Each positive integer $n>1$ can be written as $x^2+y^2+z^2+2w^2$
($x,y,z,w\in\mathbb N$) with $x+y$ prime.
  (ii) Every positive integer can be written as $x^2+y^2+z^2+2w^2$
($x,y,z,w\in\mathbb N$) with $x+2y$ prime.
  (iii) Let $k$ be any positive integer, and let $d\ge 2^{k-1}$ be a positive
odd integer with $4d^2+1$ prime. Then any sufficiently large integer can be
written as $x^2+y^2+z^2+2w^2$ $(x,y,z,w\in\mathbb N)$ with $x+2dy=p^k$ for some
prime $p$.
