I am stuck on this problem, I am trying to work out the largest possible remainder when 2015 is divided 1 or 2 or 3 ...up to 1000.

In other words, when 2015 is divided by 2 , it has a remainder 1, when divided by 5 its remainder is 0, when divided by 1000, its remainder is 15.

Which positive integer between 1 and 1000 gives the largest remainder and what is it?

I have tried pattern searching, prime factorising but no luck..