Problem #417

Bonus for p416
Public 08/04/17 8xp Math 88.9%

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: It 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.

Other Challenge Sites

Contact

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