I know there are some methods like montecarlo method to test for primality but find it difficult to implement these algorithm. I would like you give your suggestions on it. Hope you all find this discussion interesting.