Solution:
Let N=20172025!. Let p be a prime dividing 2025! other than 2017. Let pk be the largest power of p dividing 2025!. Clearly, ϕ(pk)=(p−1)pk−1 divides 2025! and gcd(2017,pk)=1, so by Euler's Totient Theorem,
N≡1(modpk).
Repeating for all such primes p, we obtain
N≡1(mod2025!/2017).
Therefore, 20172025!∣N−1, so r=20172025!s for some 0≤s<2017. Also, since N≡0 (mod 2017), we have r=20172025!s≡−1 (mod 2017).
By Wilson's,
20172025!=2016!(2018)(2019)…(2025)≡−8!≡20(mod2017).
Therefore, s is negative the inverse of 20 (mod 2017), which is 1311. Our answer is
2025!r=2025!(2025!/2017)(1311)=20171311.