use step function to find all prime numbers upto a number