$$f(x) = \sum_{i=1}^x\prod_{j=1}^ix$$
find $f(N)$mod $25602017$ $(1 \leq N \leq 10^{18})$
N and 25602017 is relative prime
I' calculate that
$$g(N)=\frac{x(x^x-1)}{x-1}$$
I'm use divide and conquer from
$$ g(N)$$
to calculate
$$x^x$$
in $O(log(x))$
Teacher reject my submission
Teacher tell me that invert mod in
$$x(x^x-1)$$
How to do?