I want to sum the following:
$$f(n) = \sum_{i=1}^n (i^3 \cdot (n \mod i))$$
Since the sum can be huge I have to output the sum modulo some given number m. How can I approach this problem?
Also, n can be upto $10^{10}$.
I want to sum the following:
$$f(n) = \sum_{i=1}^n (i^3 \cdot (n \mod i))$$
Since the sum can be huge I have to output the sum modulo some given number m. How can I approach this problem?
Also, n can be upto $10^{10}$.
Copyright © 2021 JogjaFile Inc.
As Duplicate question of this has been deleted, I am posting the snapshot of answer posted there.