We know that the number of decomposition as a sum of four squares of $n\in\mathbb{N}$ such that $n=a^2 + b^2 + c^2 + d^2$ is :
$$ r\_4(n) = 8 \sum\_{d\mid n, 4\nmid d}{d} $$
And there is a more general one from [this answer](https://mathoverflow.net/a/154134).


But is there any restriction of this function to $a,b,c,d\in\mathbb{N}^\*$ ?



Restriction of Jacobi's four-squares theorem
By inclusion-exclusion principle, the number of representations of $n$ as the sum of squares of four nonzero integers equals:
$$\sum\_{k=0}^4 \binom4k (-1)^k r\_{4-k}(n).$$
Formulae for $r\_k(n)$ are given in [this article](https://mathworld.wolfram.com/SumofSquaresFunction.html) at MathWorld.


If one wants to further restrict the representations to positive integers, the above expression needs to be divided by $2^4=16$. Numerical values are given in [A063730](https://oeis.org/A063730).


