The Table function is great for this:
l = Table[{i, PrimeQ[i]}, {i, 5000, 5050}]
Next, you might want to create a list of all of the primes in your range. You can do that with this, though there may be better ways:
primes = Cases[l, {_, True}][[All, 1]]
And, you can now find the smallest:
Min[primes]