<s>[INST] How do we count solutions of $a^2 + b^2 + c^2\equiv n\pmod p$? Let's count number of solutions of $a^2 + b^2 + c^2 \equiv n\pmod p$ for each integer $n$ and each prime $p$.  I'd start by just writing a function:
$$V_n(\mathbb{C}) = \left\{  (a,b,c) \in \mathbb{C}^3: a^2 + b^2 + c^2 = n \right\}$$
Maybe we could arrange this into some kind of Dirichlet series:
$$ f(s) = \prod_p \frac{\# V_n(\mathbb{F}_p)}{p^s}
 = \prod_p \frac{\# \{ (a,b,c): a^2 + b^2 + c^2 = n  \}}{p^s} $$
This is now a Hasse-Weil zeta function or an Arithmetic zeta function, although I didn't mean to be that advanced.
Here's the sequence of numbers for $n = 3$.  The left column is a prime number and the right column is the number of solutions.  The result looks somewhat random:
[(2, 4),
 (3, 9),
 (5, 20),
 (7, 56),
 (11, 110),
 (13, 182),
 (17, 272),
 (19, 380),
 (23, 506),
 (29, 812)]

Here is $n=7$
[(2, 4),
 (3, 6),
 (5, 20),
 (7, 49),
 (11, 132),
 (13, 156),
 (17, 272),
 (19, 342),
 (23, 552),
 (29, 870)]

 [/INST] Partial solution.
You can also rewrite it as: $$\sum_{u+v+w=n}\left(1+\left(\frac u p\right)\right)\left(1+\left(\frac v p\right)\right)\left(1+\left(\frac{w} p\right)\right)$$
This is because $1+\left(\frac mp\right)$ is the number of solutions to $x^2\equiv m\pmod{p}$.
This can then be rewritten as:
$$\sum_{u+v+w=n} \left(1+3\left(\frac{u}{p}\right)+3\left(\frac{uv}{p}\right)+\left(\frac{uvw}{p}\right)\right)$$
(Why?)
Now, $$\sum_{u+v+w=n} 1 = p^2.$$
Then convince yourself that $$\begin{align}\sum_{u+v+w=n} \left(\frac u p\right) &=0\\
\sum_{u+v+w=n}\left(\frac{uv}{p}\right)&=0
\end{align}$$
So the total is $$p^2+\sum_{u+v+w=n}\left(\frac{uvw}{p}\right)$$
Not sure how to evaluate that right-hand sum. 

When $p=3,n=5$ the total is $12.$ 
This corresponds to three permutations each of $1^2+1^2+0^2\equiv 5,\, 2^2+2^2+0^2\equiv 5,$ ands six permutations of $2^2+1^2+0^2\equiv 5.$
</s>