funtion to generate all prime numbers upto N