Problem #383
Forwardest Difference
An array A of length n = 3901585, is defined by A[i] = i^i (1 \le i \le n).
A forward difference array is the array formed by the differences of consecutive elements, i.e. [{a_1, a_2, a_3}] is replaced by [{a_2-a_1, a_3-a_2}].
Calculate the only value remaining in the (n - 1)^{th} forward difference array of A modulo 1,000,000,007.