RoseCode

Problem #417

Bonus for p416
 Public ★(x7) 08/04/17 by Min_25 8xp Math 87.5%

Let $r_3(n) = \# \{ (x, y, z) \in \mathbb{Z}^3 \mid x^2 + y^2 + z^2 = n \}$.

For example, $r_3(0) = 1$, $r_3(1) = 6$ and $r_3(100) = 30$.

Let $S(n, m) = \sum \limits _{k=0}^{m-1} r_3(n + k)$.

It can be verified that $S(1, 100) = 4168$ and $S(10^8, 100) = 6410310$.

Find $S(10^{17}, 100)$.

[My timing: 2.6 seconds (PyPy)]

Note: This would be hard without parigp and some papers.

You need to be a member to keep track of your progress.
Register

Time may end, but hope will last forever.

## Contact

elasolova
[64][103][109][97][105][108][46][99][111][109]