First number after 500 and divisible by 13 = 507 and number just less than 1000 and divisible by 13 = 998
Hence sequence
507,520,.........,988(nterms)
∴988=507+(n−1)13
∴(n−1)=481/17=37
n=38
So, there are 38 numbers between 500 & 1000 which are divisible by 13.