basic algo to find out prime number