(7)^2017 can be written as (7^2 *7^2 * 7^2.....2016/2times)*7
= (7^2 * 7^2 * 7^2.... 1008 times)*7
Remainder of (49*49*49....1008 times*7)/25= [(-1)*(-1)*(-1)....1008]*7 = 7
As rem(49/25)=-1; according to general method of finding reminder, we need to multiply the reminder of all the terms of the numerator by denominator. So -1 repeats for 1008 times and as rem(7/25)=7
on solving we have
[(-1)*(-1)*(-1)....1008]*7 = 7 is the required answer