Project Euler 745 - Sum of Squares II

Official link: https://projecteuler.net/problem=745

Thought Process

Now we can build a sieve backwards from sqrt(N) to 1.

Interactive Code

Enter a number (yourinput)

Code will output S(yourinput) % 1,000,000,007