How many integer solutions of $a^2+b^2=c^2+d^2+n$ are there? Are there any references to study the integer solutions (existence and how many) of Diophantine equations like $a^2+b^2=c^2+d^2+2$, $a^2+b^2=c^2+d^2+3$, $a^2+b^2=c^2+d^2+5$...? Actually, I can prove that there are integer solutions (a,b,c,d) for any integers n. But I don't know how to count them. Thanks a lot. 

Here's an elementary way to see that there are always plenty of solutions. Find $r$ and $s$ such that $r+s=n$ and neither $r$ nor $s$ is twice an odd number --- for large $n$, there will be many ways to do this. Then, there always exist $a,b,c,d$ such that $a^2-c^2=r$ and $b^2-d^2=s$, whence $a^2+b^2=c^2+d^2+n$. 
