I don't know if this is the right forum.
Is there a Mathematical approach to get the Modulus of a Number N which is concatenated N times?
I had the following scenario today on an Interview for a Developer Job, this was one of the questions, and only one I fail to answer.
Concatenate the number N N times and then calculate his Modulus by 2017.
For example: for N=5 the number will be 55555 and the result will be Mod(55555,2017) = 1096 for N=10 the number will be 10101010101010101010 and the result Mod(10101010101010101010,2017) = 1197
Now the Number I had to calculate was 58184241583791680. The only hint I got was that the result of 58184241583791680 concatenated 58184241583791680 times modulus 2017 is a 4 digit number.
My question is: Can we reduce somehow this number or the only solution is to concatenate it 58184241583791680 times?.