Problem Archive

Given two points $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ in three dimensional space, the Manhattan distance between those points is defined as
$|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|$.

Let $C(r)$ be a sphere with radius $r$ and center in the origin $O(0,0,0)$.
Let $I(r)$ be the set of all points with integer coordinates on the surface of $C(r)$.
Let $S(r)$ be the sum of the Manhattan distances of all elements of $I(r)$ to the origin $O$.

E.g. $S(45)=34518$.

Find $S(10^{10})$.

Solution
No solution yet. Write yours at solutions/s360.md.
Problems sourced from Project Euler · Non-commercial & educational use only · CC BY-NC-SA 4.0